Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
nsMenubarProp Class Reference

#include <nsBarProps.h>

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

List of all members.

Public Member Functions

 nsMenubarProp ()
virtual ~nsMenubarProp ()
NS_DECL_ISUPPORTS NS_IMETHOD SetWebBrowserChrome (nsIWebBrowserChrome *aBrowserChrome)
NS_IMETHOD GetVisibleByFlag (PRBool *aVisible, PRUint32 aChromeFlag)
NS_IMETHOD SetVisibleByFlag (PRBool aVisible, PRUint32 aChromeFlag)

Public Attributes

attribute boolean visible

Protected Attributes

nsIWebBrowserChromemBrowserChrome

Detailed Description

Definition at line 75 of file nsBarProps.h.


Constructor & Destructor Documentation

Definition at line 130 of file nsBarProps.cpp.

{
}

Definition at line 134 of file nsBarProps.cpp.

{
}

Member Function Documentation

NS_IMETHODIMP nsBarProp::GetVisibleByFlag ( PRBool aVisible,
PRUint32  aChromeFlag 
) [inherited]

Definition at line 83 of file nsBarProps.cpp.

{
  NS_ENSURE_TRUE(mBrowserChrome, NS_ERROR_FAILURE);

  PRUint32 chromeFlags;
  *aVisible = PR_FALSE;

  NS_ENSURE_SUCCESS(mBrowserChrome->GetChromeFlags(&chromeFlags),
                    NS_ERROR_FAILURE);
  if(chromeFlags & aChromeFlag)
    *aVisible = PR_TRUE;

  return NS_OK;
}
NS_IMETHODIMP nsBarProp::SetVisibleByFlag ( PRBool  aVisible,
PRUint32  aChromeFlag 
) [inherited]

Definition at line 99 of file nsBarProps.cpp.

{
  NS_ENSURE_TRUE(mBrowserChrome, NS_ERROR_FAILURE);

  PRBool   enabled = PR_FALSE;

  nsCOMPtr<nsIScriptSecurityManager>
           securityManager(do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID));
  if (securityManager)
    securityManager->IsCapabilityEnabled("UniversalBrowserWrite", &enabled);
  if (!enabled)
    return NS_OK;

  PRUint32 chromeFlags;

  NS_ENSURE_SUCCESS(mBrowserChrome->GetChromeFlags(&chromeFlags),
                    NS_ERROR_FAILURE);
  if(aVisible)
    chromeFlags |= aChromeFlag;
  else
    chromeFlags &= ~aChromeFlag;
  NS_ENSURE_SUCCESS(mBrowserChrome->SetChromeFlags(chromeFlags),
                    NS_ERROR_FAILURE);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 76 of file nsBarProps.cpp.

{
  mBrowserChrome = aBrowserChrome;
  return NS_OK;
}

Member Data Documentation

Definition at line 71 of file nsBarProps.h.

Definition at line 53 of file nsIDOMBarProp.idl.


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