Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Private Member Functions | Static Private Attributes
CHBrowserService Class Reference

#include <CHBrowserService.h>

Inheritance diagram for CHBrowserService:
Inheritance graph
[legend]
Collaboration diagram for CHBrowserService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CHBrowserService ()
virtual ~CHBrowserService ()
void show (in nsIHelperAppLauncher aLauncher, in nsISupports aContext, in unsigned long aReason)
nsILocalFile promptForSaveToFile (in nsIHelperAppLauncher aLauncher, in nsISupports aWindowContext, in wstring aDefaultFile, in wstring aSuggestedFileExtension)

Static Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIWINDOWCREATOR
NS_DECL_NSIFACTORY static
NS_DECL_NSIHELPERAPPLAUNCHERDIALOG
nsresult 
InitEmbedding ()
static void TermEmbedding ()
static void BrowserClosed ()
static void RegisterAppComponents (const nsModuleComponentInfo *inComponents, const int inNumComponents)
static void SetAlertController (nsAlertController *aController)
static nsAlertControllerGetAlertController ()

Public Attributes

const unsigned long REASON_CANTHANDLE = 0
 This request is passed to the helper app dialog because Gecko can not handle content of this type.
const unsigned long REASON_SERVERREQUEST = 1
 The server requested external handling.
const unsigned long REASON_TYPESNIFFED = 2
 Gecko detected that the type sent by the server (e.g.

Static Public Attributes

static PRUint32 sNumBrowsers = 0

Static Private Member Functions

static void ShutDown ()

Static Private Attributes

static CHBrowserServicesSingleton = nsnull
static nsAlertControllersController = nsnull
static PRBool sCanTerminate = PR_FALSE

Detailed Description

Definition at line 55 of file CHBrowserService.h.


Constructor & Destructor Documentation

Definition at line 64 of file CHBrowserService.mm.

{
}

Definition at line 68 of file CHBrowserService.mm.

{
}

Member Function Documentation

Definition at line 122 of file CHBrowserService.mm.

{
  sNumBrowsers--;
  if (sCanTerminate && sNumBrowsers == 0) {
    // The app is terminating *and* our count dropped to 0.
    ShutDown();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 167 of file CHBrowserService.mm.

{
  if (!sController) {
    NSBundle* bundle = [NSBundle bundleForClass:[CHBrowserView class]];
    [bundle loadNibFile:@NS_ALERT_NIB_NAME externalNameTable:nsnull withZone:[NSApp zone]];
  }
  return sController;
}
NS_DECL_ISUPPORTS NS_DECL_NSIWINDOWCREATOR NS_DECL_NSIFACTORY static NS_DECL_NSIHELPERAPPLAUNCHERDIALOG nsresult CHBrowserService::InitEmbedding ( ) [static]

Here is the caller graph for this function:

nsILocalFile nsIHelperAppLauncherDialog::promptForSaveToFile ( in nsIHelperAppLauncher  aLauncher,
in nsISupports  aWindowContext,
in wstring  aDefaultFile,
in wstring  aSuggestedFileExtension 
) [inherited]
void CHBrowserService::RegisterAppComponents ( const nsModuleComponentInfo inComponents,
const int  inNumComponents 
) [static]

Definition at line 269 of file CHBrowserService.mm.

{
  nsCOMPtr<nsIComponentRegistrar> cr;
  NS_GetComponentRegistrar(getter_AddRefs(cr));
  if ( !cr )
    return;

  for (int i = 0; i < inNumComponents; ++i) {
    nsCOMPtr<nsIGenericFactory> componentFactory;
    nsresult rv = NS_NewGenericFactory(getter_AddRefs(componentFactory), &(inComponents[i]));
    if (NS_FAILED(rv)) {
      NS_ASSERTION(PR_FALSE, "Unable to create factory for component");
      continue;
    }

    rv = cr->RegisterFactory(inComponents[i].mCID,
                             inComponents[i].mDescription,
                             inComponents[i].mContractID,
                             componentFactory);
    NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to register factory for component");
  }
}

Here is the call graph for this function:

Definition at line 177 of file CHBrowserService.mm.

{
  // XXX When should the controller be released?
  sController = aController;
  [sController retain];
}

Here is the caller graph for this function:

void nsIHelperAppLauncherDialog::show ( in nsIHelperAppLauncher  aLauncher,
in nsISupports  aContext,
in unsigned long  aReason 
) [inherited]
void CHBrowserService::ShutDown ( ) [static, private]

Definition at line 152 of file CHBrowserService.mm.

{
  // phase 2 notifcation (we really are about to terminate)
  [[NSNotificationCenter defaultCenter] postNotificationName:XPCOMShutDownNotificationName object:nil];

  NS_IF_RELEASE(sSingleton);
  NS_TermEmbedding();
#if DEBUG
  NSLog(@"Shutting down embedding.");
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file CHBrowserService.mm.

{
  // phase 1 notification (we're trying to terminate)
  [[NSNotificationCenter defaultCenter] postNotificationName:TermEmbeddingNotificationName object:nil];

  sCanTerminate = PR_TRUE;
  if (sNumBrowsers == 0) {
    ShutDown();
  }
  else {
#if DEBUG
       NSLog(@"Cannot yet shut down embedding.");
#endif
    // Otherwise we cannot yet terminate.  We have to let the death of the browser views
    // induce termination.
  }
}

Here is the call graph for this function:


Member Data Documentation

This request is passed to the helper app dialog because Gecko can not handle content of this type.

Definition at line 62 of file nsIHelperAppLauncherDialog.idl.

The server requested external handling.

Definition at line 67 of file nsIHelperAppLauncherDialog.idl.

Gecko detected that the type sent by the server (e.g.

text/plain) does not match the actual type.

Definition at line 73 of file nsIHelperAppLauncherDialog.idl.

Definition at line 89 of file CHBrowserService.h.

Definition at line 88 of file CHBrowserService.h.

Definition at line 82 of file CHBrowserService.h.

Definition at line 87 of file CHBrowserService.h.


The documentation for this class was generated from the following files: