Difference between revisions of "Chrome"
(→What is Chrome?) |
(→What is Chrome?) |
||
Line 1: | Line 1: | ||
=What is Chrome?= | =What is Chrome?= | ||
− | Chrome is the user interface | + | In a nutshell, Chrome is the user interface of Mozilla products. The user interface is composed mostly of XUL, XBL, CSS, and JS files. Extensions are (usually) chrome applets. 90% of an [http://developer.mozilla.org/en/docs/Extensions extension], typically is chrome. |
− | |||
− | + | In the XUL world, Chrome is the top level window which contains groups of UI elements of various types. Example of chrome are the browser window and dialog window. The chrome obtains its UI description from four types of providers: | |
+ | |||
+ | * Content provider | ||
+ | ::Provides the skeleton, i.e., the menus, command buttons | ||
+ | * Skin provider | ||
+ | ::Supplies the look-and-feel of the chrome | ||
+ | * Platform provider | ||
+ | ::Gives platform dependent UI description | ||
+ | * Locale provider | ||
+ | ::Offers the language and culture sensitive resources | ||
=More= | =More= |
Revision as of 02:26, 6 October 2006
Contents
What is Chrome?
In a nutshell, Chrome is the user interface of Mozilla products. The user interface is composed mostly of XUL, XBL, CSS, and JS files. Extensions are (usually) chrome applets. 90% of an extension, typically is chrome.
In the XUL world, Chrome is the top level window which contains groups of UI elements of various types. Example of chrome are the browser window and dialog window. The chrome obtains its UI description from four types of providers:
- Content provider
- Provides the skeleton, i.e., the menus, command buttons
- Skin provider
- Supplies the look-and-feel of the chrome
- Platform provider
- Gives platform dependent UI description
- Locale provider
- Offers the language and culture sensitive resources
More
Chrome Registry
The chrome registry is a file that lists each major Mozilla component and where in the chrome directory its UI files are located. It is located in the chrome directory itself and is called either chrome.rdf or installed-chrome.txt (or both).
A supplier of chrome for a given window type (e.g., for the browser window) is called a chrome provider. The providers work together to supply a complete set of chrome for a particular window, from the images on the toolbar buttons to the files that describe the text, contents and appearance of the window itself.
There are three basic types of chrome providers:
Content
The main source file for a window description comes from the content provider, and it can be any file type viewable from within Mozilla. It will typically be a XUL file, since XUL is designed for describing the contents of windows and dialogs. The javascript files that define the user interface are also contained within the content packages, as well as most XBL binding files.
Locale
Localizable applications keep all their localized information in locale providers. This allows translators to plug in a different chrome package to translate an application without altering the rest of the source code. The two main types of localizable files are DTD files and java-style properties files.
Skin
A skin provider is responsible for providing a complete set of files that describe the visual appearance of the chrome. Typically a skin provider will provide CSS files and images.
What you can do with Chrome
Here are the following examples of what you can do with Chrome:
- Create a skin for Mozilla
- Working with windows in Chrome Code
- Create toolbar buttons
- Create a Firefox sidebar
Resources
Configurable Chrome by Benjamin Smedberg <benjamin@smedbergs.us>
http://www.mozilla.org/support/firefox/tips
http://developer.mozilla.org/en/docs/Working_with_windows_in_chrome_code