mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 21:58:06 +00:00
Bug 288075 -browser <URL> should open in a browser window r=bsmedberg sr=darin
This commit is contained in:
parent
1bb3982eb2
commit
c4ea9270d0
@ -58,6 +58,7 @@ interface nsIBrowserInstance : nsISupports {
|
||||
|
||||
#define NS_BROWSERINSTANCE_CONTRACTID "@mozilla.org/appshell/component/browser/instance;1"
|
||||
#define NS_BROWSERSTARTUPHANDLER_CONTRACTID "@mozilla.org/commandlinehandler/general-startup;1?type=browser"
|
||||
#define NS_CHROMESTARTUPHANDLER_CONTRACTID "@mozilla.org/commandlinehandler/general-startup;1?type=chrome"
|
||||
|
||||
// {c7bee75a-1dd1-11b2-9333-a38e085287cf}
|
||||
#define NS_BROWSERCONTROLLER_CID { 0xc7bee75a, 0x1dd1, 0x11b2, { 0x93, 0x33, 0xa3, 0x8e, 0x08, 0x52, 0x87, 0xcf } }
|
||||
@ -68,4 +69,7 @@ interface nsIBrowserInstance : nsISupports {
|
||||
// {C2343730-DC2C-11d3-98B3-001083010E9B}
|
||||
#define NS_BROWSERCONTENTHANDLER_CID { 0xc2343730, 0xdc2c, 0x11d3, { 0x98, 0xb3, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
|
||||
|
||||
// {406B41R2-98B1-40B2-99R3-8A326CDC1F30}
|
||||
#define NS_CHROMESTARTUPHANDLER_CID { 0x406b41e2, 0x98b1, 0x40b2, { 0x99, 0xe3, 0x8a, 0x32, 0x6c, 0xdc, 0x1f, 0x30 } }
|
||||
|
||||
%}
|
||||
|
@ -630,26 +630,19 @@ nsBrowserInstance::Close()
|
||||
// return DOM objects. And we need a dom window to bootstrap the browser
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsChromeStartupHandler, nsICmdLineHandler)
|
||||
CMDLINEHANDLER_IMPL(nsChromeStartupHandler, "-chrome", "", "",
|
||||
"Load the specified chrome.",
|
||||
NS_CHROMESTARTUPHANDLER_CONTRACTID,
|
||||
"Chrome Startup Handler", PR_TRUE, "", PR_FALSE)
|
||||
|
||||
NS_IMPL_ADDREF(nsBrowserContentHandler)
|
||||
NS_IMPL_RELEASE(nsBrowserContentHandler)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsBrowserContentHandler)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentHandler)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContentHandler)
|
||||
NS_INTERFACE_MAP_ENTRY(nsICmdLineHandler)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
nsBrowserContentHandler::nsBrowserContentHandler()
|
||||
{
|
||||
}
|
||||
|
||||
nsBrowserContentHandler::~nsBrowserContentHandler()
|
||||
{
|
||||
}
|
||||
|
||||
CMDLINEHANDLER_OTHERS_IMPL(nsBrowserContentHandler,"-chrome","general.startup.browser","Load the specified chrome.", PR_TRUE, PR_FALSE)
|
||||
CMDLINEHANDLER_REGISTERPROC_IMPL(nsBrowserContentHandler, "Browser Startup Handler", NS_BROWSERSTARTUPHANDLER_CONTRACTID)
|
||||
NS_IMPL_ISUPPORTS2(nsBrowserContentHandler, nsIContentHandler, nsICmdLineHandler)
|
||||
CMDLINEHANDLER_OTHERS_IMPL(nsBrowserContentHandler, "-browser",
|
||||
"general.startup.browser", "Load the browser.",
|
||||
PR_TRUE, PR_TRUE)
|
||||
CMDLINEHANDLER_REGISTERPROC_IMPL(nsBrowserContentHandler,
|
||||
"Browser Startup Handler",
|
||||
NS_BROWSERSTARTUPHANDLER_CONTRACTID)
|
||||
NS_IMETHODIMP nsBrowserContentHandler::GetChromeUrlForTask(char **aChromeUrlForTask) {
|
||||
|
||||
if (!aChromeUrlForTask)
|
||||
|
@ -97,6 +97,14 @@ class nsBrowserInstance : public nsIBrowserInstance,
|
||||
};
|
||||
|
||||
#ifndef MOZ_XUL_APP
|
||||
class nsChromeStartupHandler : public nsICmdLineHandler
|
||||
{
|
||||
public:
|
||||
NS_DECL_NSICMDLINEHANDLER
|
||||
NS_DECL_ISUPPORTS
|
||||
CMDLINEHANDLER_REGISTERPROC_DECLS
|
||||
};
|
||||
|
||||
class nsBrowserContentHandler : public nsIContentHandler, public nsICmdLineHandler
|
||||
{
|
||||
public:
|
||||
@ -105,9 +113,6 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
CMDLINEHANDLER_REGISTERPROC_DECLS
|
||||
|
||||
nsBrowserContentHandler();
|
||||
virtual ~nsBrowserContentHandler();
|
||||
|
||||
protected:
|
||||
PRBool NeedHomepageOverride(nsIPref *aPrefService);
|
||||
};
|
||||
|
@ -383,9 +383,11 @@ static const nsModuleComponentInfo components[] = {
|
||||
nsBrowserContentHandler::UnregisterProc,
|
||||
},
|
||||
{ "Chrome Startup Handler",
|
||||
NS_BROWSERCONTENTHANDLER_CID,
|
||||
"@mozilla.org/commandlinehandler/general-startup;1?type=chrome",
|
||||
nsBrowserContentHandlerConstructor,
|
||||
NS_CHROMESTARTUPHANDLER_CID,
|
||||
NS_CHROMESTARTUPHANDLER_CONTRACTID,
|
||||
nsChromeStartupHandlerConstructor,
|
||||
nsChromeStartupHandler::RegisterProc,
|
||||
nsChromeStartupHandler::UnregisterProc
|
||||
},
|
||||
#endif //!defined(MOZ_XUL_APP) && !defined(MOZ_MACBROWSER)
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user