Back to index

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

#include <nsXBLPrototypeResources.h>

Collaboration diagram for nsXBLPrototypeResources:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void LoadResources (PRBool *aResult)
void AddResource (nsIAtom *aResourceType, const nsAString &aSrc)
void AddResourceListener (nsIContent *aElement)
nsresult FlushSkinSheets ()
 nsXBLPrototypeResources (nsXBLPrototypeBinding *aBinding)
 ~nsXBLPrototypeResources ()

Public Attributes

nsXBLResourceLoadermLoader
nsCOMArray< nsICSSStyleSheetmStyleSheetList
nsCOMPtr< nsIStyleRuleProcessormRuleProcessor

Detailed Description

Definition at line 60 of file nsXBLPrototypeResources.h.


Constructor & Destructor Documentation


Member Function Documentation

void nsXBLPrototypeResources::AddResource ( nsIAtom aResourceType,
const nsAString &  aSrc 
)

Definition at line 76 of file nsXBLPrototypeResources.cpp.

{
  if (mLoader)
    mLoader->AddResource(aResourceType, aSrc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 92 of file nsXBLPrototypeResources.cpp.

{
  if (mLoader)
    mLoader->AddResourceListener(aBoundElement);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 107 of file nsXBLPrototypeResources.cpp.

{
  if (mStyleSheetList.Count() == 0)
    return NS_OK;

  nsresult rv;
  // XXXbz should be getting loader off the document or something
  nsCOMPtr<nsICSSLoader> loader = do_CreateInstance(kCSSLoaderCID, &rv);
  if (NS_FAILED(rv)) return rv;
  
  // We have scoped stylesheets.  Reload any chrome stylesheets we
  // encounter.  (If they aren't skin sheets, it doesn't matter, since
  // they'll still be in the chrome cache.
  mRuleProcessor = nsnull;

  nsCOMArray<nsICSSStyleSheet> oldSheets(mStyleSheetList);
  mStyleSheetList.Clear();
  
  PRInt32 i;
  PRInt32 count = oldSheets.Count();
  for (i = 0; i < count; i++) {
    nsICSSStyleSheet* oldSheet = oldSheets[i];
    
    nsCOMPtr<nsIURI> uri;
    oldSheet->GetSheetURI(getter_AddRefs(uri));

    nsCOMPtr<nsICSSStyleSheet> newSheet;
    if (IsChromeURI(uri)) {
      if (NS_FAILED(loader->LoadAgentSheet(uri, getter_AddRefs(newSheet))))
        continue;
    }
    else {
      newSheet = oldSheet;
    }
    
    mStyleSheetList.AppendObject(newSheet);
  }
  mRuleProcessor = new nsCSSRuleProcessor(mStyleSheetList);
  
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 83 of file nsXBLPrototypeResources.cpp.

{
  if (mLoader)
    mLoader->LoadResources(aResult);
  else
    *aResult = PR_TRUE; // All resources loaded.
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 72 of file nsXBLPrototypeResources.h.

Definition at line 76 of file nsXBLPrototypeResources.h.

Definition at line 73 of file nsXBLPrototypeResources.h.


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