Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsBrowserInstance.cpp File Reference
#include "nsBrowserInstance.h"
#include "nsIGenericFactory.h"
#include "nsIBaseWindow.h"
#include "nsIWebNavigationInfo.h"
#include "nsDocShellCID.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIHttpProtocolHandler.h"
#include "nsISHistory.h"
#include "nsIWebNavigation.h"
#include "nsIObserver.h"
#include "pratom.h"
#include "prprf.h"
#include "nsIComponentManager.h"
#include "nsCRT.h"
#include "nsIScriptContext.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMDocument.h"
#include "nsIDOMWindowInternal.h"
#include "nsIContentViewer.h"
#include "nsIContentViewerEdit.h"
#include "nsIWebBrowserChrome.h"
#include "nsIWindowWatcher.h"
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsIPref.h"
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsIIOService.h"
#include "nsIWidget.h"
#include "plevent.h"
#include "plstr.h"
#include "nsIAppStartup.h"
#include "nsIBrowserHistory.h"
#include "nsIObserverService.h"
#include "nsILocalFile.h"
#include "nsDirectoryServiceDefs.h"
#include "nsNetUtil.h"
#include "nsICmdLineService.h"
#include "nsIProxyObjectManager.h"
#include "nsXPFEComponentsCID.h"

Go to the source code of this file.

Defines

#define APP_DEBUG   0
#define PREF_HOMEPAGE_OVERRIDE_URL   "startup.homepage_override_url"
#define PREF_HOMEPAGE_OVERRIDE_MSTONE   "browser.startup.homepage_override.mstone"
#define PREF_BROWSER_STARTUP_PAGE   "browser.startup.page"
#define PREF_BROWSER_STARTUP_HOMEPAGE   "browser.startup.homepage"

Functions

static NS_DEFINE_CID (kPrefServiceCID, NS_PREF_CID)
 Unsorted Includes.
static NS_DEFINE_CID (kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID)
 CMDLINEHANDLER_IMPL (nsChromeStartupHandler,"-chrome","","","Load the specified chrome.", NS_CHROMESTARTUPHANDLER_CONTRACTID,"Chrome Startup Handler", PR_TRUE,"", PR_FALSE) CMDLINEHANDLER_OTHERS_IMPL(nsBrowserContentHandler
general startup Load the PR_TRUE CMDLINEHANDLER_REGISTERPROC_IMPL (nsBrowserContentHandler,"Browser Startup Handler", NS_BROWSERSTARTUPHANDLER_CONTRACTID) NS_IMETHODIMP nsBrowserContentHandler
nsresult GetHomePageGroup (nsIPref *aPref, PRUnichar **aResult)

Variables

const char * kIgnoreOverrideMilestone = "ignore"
 browser
general startup Load the PR_TRUE

Define Documentation

#define APP_DEBUG   0

Definition at line 118 of file nsBrowserInstance.cpp.

#define PREF_BROWSER_STARTUP_HOMEPAGE   "browser.startup.homepage"

Definition at line 125 of file nsBrowserInstance.cpp.

#define PREF_BROWSER_STARTUP_PAGE   "browser.startup.page"

Definition at line 124 of file nsBrowserInstance.cpp.

#define PREF_HOMEPAGE_OVERRIDE_MSTONE   "browser.startup.homepage_override.mstone"

Definition at line 123 of file nsBrowserInstance.cpp.

#define PREF_HOMEPAGE_OVERRIDE_URL   "startup.homepage_override_url"

Definition at line 122 of file nsBrowserInstance.cpp.


Function Documentation

CMDLINEHANDLER_IMPL ( nsChromeStartupHandler  ,
"-chrome"  ,
""  ,
""  ,
"Load the specified chrome."  ,
NS_CHROMESTARTUPHANDLER_CONTRACTID  ,
"Chrome Startup Handler"  ,
PR_TRUE  ,
""  ,
PR_FALSE   
)
general startup Load the PR_TRUE CMDLINEHANDLER_REGISTERPROC_IMPL ( nsBrowserContentHandler  ,
"Browser Startup Handler"  ,
NS_BROWSERSTARTUPHANDLER_CONTRACTID   
)

Definition at line 646 of file nsBrowserInstance.cpp.

                                                                                   {

  if (!aChromeUrlForTask)
    return NS_ERROR_NULL_POINTER;

  nsresult rv = NS_ERROR_FAILURE;
  nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
  if (prefs) {
    rv = prefs->CopyCharPref("browser.chromeURL", aChromeUrlForTask);
    if (NS_SUCCEEDED(rv) && (*aChromeUrlForTask)[0] == '\0') {
      PL_strfree(*aChromeUrlForTask);
      rv = NS_ERROR_FAILURE;
    }
  }
  if (NS_FAILED(rv))
    *aChromeUrlForTask = PL_strdup("chrome://navigator/content/navigator.xul");

  return NS_OK;
}

Here is the call graph for this function:

nsresult GetHomePageGroup ( nsIPref aPref,
PRUnichar **  aResult 
)

Definition at line 703 of file nsBrowserInstance.cpp.

{
  nsresult rv;

  nsXPIDLString uri;
  rv = aPref->GetLocalizedUnicharPref(PREF_BROWSER_STARTUP_HOMEPAGE, getter_Copies(uri));
  if (NS_FAILED(rv))
    return rv;

  PRInt32 count = 0;
  rv = aPref->GetIntPref("browser.startup.homepage.count", &count);

  // if we couldn't get the pref (unlikely) or only have one homepage
  if (NS_FAILED(rv) || count <= 1) {
    *aResult = ToNewUnicode(uri);
    return NS_OK;
  }

  // The "homepage" is a group of pages, put them in uriList separated by '\n'
  nsAutoString uriList(uri);

  for (PRInt32 i = 1; i < count; ++i) {
    nsCAutoString pref(NS_LITERAL_CSTRING("browser.startup.homepage."));
    pref.AppendInt(i);

    rv = aPref->GetLocalizedUnicharPref(pref.get(), getter_Copies(uri));
    if (NS_FAILED(rv))
      return rv;

    uriList.Append(PRUnichar('\n'));
    uriList.Append(uri);
  }

  *aResult = ToNewUnicode(uriList);
  return NS_OK;
}

Here is the call graph for this function:

static NS_DEFINE_CID ( kPrefServiceCID  ,
NS_PREF_CID   
) [static]

Unsorted Includes.

static NS_DEFINE_CID ( kProxyObjectManagerCID  ,
NS_PROXYEVENT_MANAGER_CID   
) [static]

Variable Documentation

general startup Load the browser

Definition at line 643 of file nsBrowserInstance.cpp.

const char* kIgnoreOverrideMilestone = "ignore"

Definition at line 127 of file nsBrowserInstance.cpp.

general startup Load the PR_TRUE

Definition at line 643 of file nsBrowserInstance.cpp.