NsBrowserGlue - @line 43"e\builds\moz2_slave\win32_build\build\browser\components\nsBrowserGlue.js const const const const Ci Cc Cr Cu = = = =

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
[email protected] 43 "e:\builds\moz2_slave\win32_build\build\browser\components\nsBrowserGlue.js" const Ci = Components.interfaces; const Cc = Components.classes; const Cr = Components.results; const Cu = Components.utils; const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/distribution.js"); const PREF_EM_NEW_ADDONS_LIST = "extensions.newAddons"; const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser"; const PREF_PLUGINS_UPDATEURL = "plugins.update.url"; // Check to see if bookmarks need backing up once per // day on 1 hour idle. const BOOKMARKS_ARCHIVE_IDLE_TIME = 60 * 60; // Backup bookmarks once every 24 hours. const BOOKMARKS_ARCHIVE_INTERVAL = 86400 * 1000; // Factory object const BrowserGlueServiceFactory = { _instance: null, createInstance: function (outer, iid) { if (outer != null) throw Components.results.NS_ERROR_NO_AGGREGATION; return this._instance == null ? this._instance = new BrowserGlue() : this._instance; } }; // Constructor function BrowserGlue() { this.__defineGetter__("_prefs", function() { delete this._prefs; return this._prefs = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); }); this.__defineGetter__("_bundleService", function() { delete this._bundleService; return this._bundleService = Cc["@mozilla.org/intl/stringbundle;1"]. getService(Ci.nsIStringBundleService); }); this.__defineGetter__("_idleService", function() { delete this._idleService; return this._idleService = Cc["@mozilla.org/widget/idleservice;1"]. getService(Ci.nsIIdleService); }); this.__defineGetter__("_observerService", function() {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
delete this._observerService; return this._observerService = Cc[[email protected]/observer-service;1']. getService(Ci.nsIObserverService); }); this.__defineGetter__("_distributionCustomizer", function() { delete this._distributionCustomizer; return this._distributionCustomizer = new DistributionCustomizer() }); this._init(); } [email protected] 118 "e:\builds\moz2_slave\win32_build\build\browser\components\nsBrowserGlue.js" BrowserGlue.prototype = { _saveSession: false, _setPrefToSaveSession: function() { this._prefs.setBoolPref("browser.sessionstore.resume_session_once", true); // This method can be called via [NSApplication terminate:] on Mac, which // ends up causing prefs not to be flushed to disk, so we need to do that // explicitly here. See bug 497652. this._prefs.QueryInterface(Ci.nsIPrefService).savePrefFile(null); }, // nsIObserver implementation observe: function(subject, topic, data) { switch(topic) { case "xpcom-shutdown": this._dispose(); break; case "prefservice:after-app-defaults": this._onAppDefaults(); break; case "final-ui-startup": this._onProfileStartup(); break; case "sessionstore-windows-restored": this._onBrowserStartup(); break; case "browser:purge-session-history": // reset the console service's error buffer const cs = Cc["@mozilla.org/consoleservice;1"]. getService(Ci.nsIConsoleService);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/11/2010 for the course ISD 125 taught by Professor 3ant during the Spring '10 term at École Normale Supérieure.

Page1 / 21

NsBrowserGlue - @line 43"e\builds\moz2_slave\win32_build\build\browser\components\nsBrowserGlue.js const const const const Ci Cc Cr Cu = = = =

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online