Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
Mozilla::Embedding::Gecko Class Reference

#include <DotNETEmbed.h>

Collaboration diagram for Mozilla::Embedding::Gecko:
Collaboration graph

List of all members.

Public Member Functions

 Gecko ()
void OpenURL (String *url)

Static Public Member Functions

static void TermEmbedding ()

Protected Member Functions

void OnResize (EventArgs *e)

Private Member Functions

void CreateBrowserWindow (PRUint32 aChromeFlags, nsIWebBrowserChrome *aParent)

Private Attributes


Static Private Attributes

static bool sIsInitialized = false

Detailed Description

Definition at line 57 of file DotNETEmbed.h.

Constructor & Destructor Documentation

Definition at line 311 of file DotNETEmbed.cpp.

  : mChrome(nsnull)

Here is the caller graph for this function:

Member Function Documentation

void Gecko::CreateBrowserWindow ( PRUint32  aChromeFlags,
nsIWebBrowserChrome aParent 
) [private]

Definition at line 387 of file DotNETEmbed.cpp.

  WebBrowserChrome * chrome = new WebBrowserChrome();
  if (!chrome) {
    throw new OutOfMemoryException();

  mChrome = chrome;

  // XXX: Is this really needed?
  // now an extra addref; the window owns itself (to be released by
  // WebBrowserChromeUI::Destroy)


  HWND hWnd = (HWND)Handle.ToPointer();

  // Insert the browser
  nsCOMPtr<nsIWebBrowser> newBrowser;
  chrome->CreateBrowser(hWnd, -1, -1, -1, -1, getter_AddRefs(newBrowser));
  if (!newBrowser) {

  // Place it where we want it.

  // if opened as chrome, it'll be made visible after the chrome has loaded.
  // otherwise, go ahead and show it now.
  if (!(aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME))
    ::ShowWindow(hWnd, SW_RESTORE);

Here is the call graph for this function:

Here is the caller graph for this function:

void Gecko::OnResize ( EventArgs *  e) [protected]

Definition at line 360 of file DotNETEmbed.cpp.

  if (mChrome) {
    nsCOMPtr<nsIEmbeddingSiteWindow> embeddingSite =

    RECT rect;
    GetClientRect((HWND)Handle.ToPointer(), &rect);

    // Make sure the browser is visible and sized
    nsCOMPtr<nsIWebBrowser> webBrowser;
    nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(webBrowser);
    if (webBrowserAsWin) {
                                          rect.right - rect.left,
                                          rect.bottom -,


Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 330 of file DotNETEmbed.cpp.

  if (!sIsInitialized) {
    nsresult rv = NS_InitEmbedding(nsnull, nsnull);

    sIsInitialized = true;

  const wchar_t __pin * url = PtrToStringChars(aUrl);
  nsresult rv;

  HWND hWnd = (HWND)Handle.ToPointer();

  if (!mChrome) {
    CreateBrowserWindow(nsIWebBrowserChrome::CHROME_ALL, nsnull);

  // Start loading a page
  nsCOMPtr<nsIWebBrowser> newBrowser;
  nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(newBrowser));

  rv = webNav->LoadURI(url, nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull,


Here is the call graph for this function:

void Gecko::TermEmbedding ( ) [static]

Definition at line 317 of file DotNETEmbed.cpp.

  if (!sIsInitialized) {

  sIsInitialized = false;

  nsresult rv = NS_TermEmbedding();

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Definition at line 74 of file DotNETEmbed.h.

Definition at line 76 of file DotNETEmbed.h.

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