Skip to content

Commit

Permalink
Backed out changeset a6d5fda15815 for bug 532542 due to a test failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dietrich Ayala committed Dec 16, 2009
1 parent 5cafb80 commit a150da6
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions browser/components/nsBrowserGlue.js
Expand Up @@ -66,7 +66,8 @@ const BOOKMARKS_BACKUP_MAX_BACKUPS = 10;
// Factory object
const BrowserGlueServiceFactory = {
_instance: null,
createInstance: function BGSF_createInstance(outer, iid) {
createInstance: function (outer, iid)
{
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return this._instance == null ?
Expand Down Expand Up @@ -123,7 +124,8 @@ BrowserGlue.prototype = {
_isPlacesLockedObserver: false,
_isPlacesDatabaseLocked: false,

_setPrefToSaveSession: function BG__setPrefToSaveSession(aForce) {
_setPrefToSaveSession: function(aForce)
{
if (!this._saveSession && !aForce)
return;

Expand All @@ -136,7 +138,8 @@ BrowserGlue.prototype = {
},

// nsIObserver implementation
observe: function BG_observe(subject, topic, data) {
observe: function(subject, topic, data)
{
switch(topic) {
case "xpcom-shutdown":
this._dispose();
Expand Down Expand Up @@ -214,7 +217,8 @@ BrowserGlue.prototype = {
},

// initialization (called on application startup)
_init: function BG__init() {
_init: function()
{
// observer registration
const osvr = this._observerService;
osvr.addObserver(this, "xpcom-shutdown", false);
Expand All @@ -237,7 +241,8 @@ BrowserGlue.prototype = {
},

// cleanup (called on application shutdown)
_dispose: function BG__dispose() {
_dispose: function()
{
// observer removal
const osvr = this._observerService;
osvr.removeObserver(this, "xpcom-shutdown");
Expand All @@ -260,14 +265,16 @@ BrowserGlue.prototype = {
osvr.removeObserver(this, "places-database-locked");
},

_onAppDefaults: function BG__onAppDefaults() {
_onAppDefaults: function()
{
// apply distribution customizations (prefs)
// other customizations are applied in _onProfileStartup()
this._distributionCustomizer.applyPrefDefaults();
},

// profile startup handler (contains profile initialization routines)
_onProfileStartup: function BG__onProfileStartup() {
_onProfileStartup: function()
{
this._sanitizer.onStartup();
// check if we're in safe mode
var app = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo).
Expand Down Expand Up @@ -307,7 +314,7 @@ BrowserGlue.prototype = {
},

// profile shutdown handler (contains profile cleanup routines)
_onProfileShutdown: function BG__onProfileShutdown() {
_onProfileShutdown: function()
{
#ifdef WINCE
// If there's a pending update, clear cache to free up disk space.
Expand All @@ -328,7 +335,7 @@ BrowserGlue.prototype = {
},

// Browser startup complete. All initial windows have opened.
_onBrowserStartup: function BG__onBrowserStartup() {
_onBrowserStartup: function()
{
// Show about:rights notification, if needed.
if (this._shouldShowRights())
Expand Down Expand Up @@ -382,7 +389,8 @@ BrowserGlue.prototype = {
#endif
},

_onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
_onQuitRequest: function(aCancelQuit, aQuitType)
{
// If user has already dismissed quit request, then do nothing
if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data)
return;
Expand Down Expand Up @@ -507,7 +515,7 @@ BrowserGlue.prototype = {
* before, if a newer version is available, or if the override pref says to
* always show it.
*/
_shouldShowRights: function BG__shouldShowRights() {
_shouldShowRights : function () {
// Look for an unconditional override pref. If set, do what it says.
// (true --> never show, false --> always show)
try {
Expand Down Expand Up @@ -539,7 +547,7 @@ BrowserGlue.prototype = {
return true;
},

_showRightsNotification: function BG__showRightsNotification() {
_showRightsNotification : function () {
// Stick the notification onto the selected tab of the active browser window.
var win = this.getMostRecentBrowserWindow();
var browser = win.gBrowser; // for closure in notification bar callback
Expand Down Expand Up @@ -572,7 +580,7 @@ BrowserGlue.prototype = {
box.persistence = 3; // arbitrary number, just so bar sticks around for a bit
},

_showPluginUpdatePage: function BG__showPluginUpdatePage() {
_showPluginUpdatePage : function () {
this._prefs.setBoolPref(PREF_PLUGINS_NOTIFYUSER, false);

var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
Expand Down Expand Up @@ -604,7 +612,7 @@ BrowserGlue.prototype = {
* Set to true by safe-mode dialog to indicate we must restore default
* bookmarks.
*/
_initPlaces: function BG__initPlaces() {
_initPlaces: function bg__initPlaces() {
// We must instantiate the history service since it will tell us if we
// need to import or restore bookmarks due to first-run, corruption or
// forced migration (due to a major schema change).
Expand Down Expand Up @@ -750,7 +758,7 @@ BrowserGlue.prototype = {
* Note: quit-application-granted notification is received twice
* so replace this method with a no-op when first called.
*/
_shutdownPlaces: function BG__shutdownPlaces() {
_shutdownPlaces: function bg__shutdownPlaces() {
this._backupBookmarks();

// Backup bookmarks to bookmarks.html to support apps that depend
Expand All @@ -770,7 +778,7 @@ BrowserGlue.prototype = {
/**
* Backup bookmarks if needed.
*/
_backupBookmarks: function BG__backupBookmarks() {
_backupBookmarks: function nsBrowserGlue__backupBookmarks() {
Cu.import("resource://gre/modules/utils.js");

let lastBackupFile = PlacesUtils.backups.getMostRecent();
Expand All @@ -792,7 +800,7 @@ BrowserGlue.prototype = {
/**
* Show the notificationBox for a locked places database.
*/
_showPlacesLockedNotificationBox: function BG__showPlacesLockedNotificationBox() {
_showPlacesLockedNotificationBox: function nsBrowserGlue__showPlacesLockedNotificationBox() {
var brandBundle = this._bundleService.createBundle("chrome://branding/locale/brand.properties");
var applicationName = brandBundle.GetStringFromName("brandShortName");
var placesBundle = this._bundleService.createBundle("chrome://browser/locale/places/places.properties");
Expand Down Expand Up @@ -827,7 +835,7 @@ BrowserGlue.prototype = {
box.persistence = -1; // Until user closes it
},

_migrateUI: function BG__migrateUI() {
_migrateUI: function bg__migrateUI() {
var migration = 0;
try {
migration = this._prefs.getIntPref("browser.migration.version");
Expand Down Expand Up @@ -878,14 +886,14 @@ BrowserGlue.prototype = {
}
},

_getPersist: function BG__getPersist(aSource, aProperty) {
_getPersist: function bg__getPersist(aSource, aProperty) {
var target = this._dataSource.GetTarget(aSource, aProperty, true);
if (target instanceof Ci.nsIRDFLiteral)
return target.Value;
return null;
},

_setPersist: function BG__setPersist(aSource, aProperty, aTarget) {
_setPersist: function bg__setPersist(aSource, aProperty, aTarget) {
this._dirty = true;
try {
var oldTarget = this._dataSource.GetTarget(aSource, aProperty, true);
Expand All @@ -906,12 +914,12 @@ BrowserGlue.prototype = {
// public nsIBrowserGlue members
// ------------------------------

sanitize: function BG_sanitize(aParentWindow) {
sanitize: function(aParentWindow)
{
this._sanitizer.sanitize(aParentWindow);
},

ensurePlacesDefaultQueriesInitialized:
function BG_ensurePlacesDefaultQueriesInitialized() {
ensurePlacesDefaultQueriesInitialized: function() {
// This is actual version of the smart bookmarks, must be increased every
// time smart bookmarks change.
// When adding a new smart bookmark below, its newInVersion property must
Expand Down Expand Up @@ -943,13 +951,13 @@ BrowserGlue.prototype = {
getService(Ci.nsIAnnotationService);

var callback = {
_uri: function BG_EPDQI__uri(aSpec) {
_uri: function(aSpec) {
return Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).
newURI(aSpec, null, null);
},

runBatched: function BG_EPDQI_runBatched() {
runBatched: function() {
var smartBookmarks = [];
var bookmarksMenuIndex = 0;
var bookmarksToolbarIndex = 0;
Expand Down Expand Up @@ -1074,7 +1082,8 @@ BrowserGlue.prototype = {
#endif

// this returns the most recent non-popup browser window
getMostRecentBrowserWindow: function BG_getMostRecentBrowserWindow() {
getMostRecentBrowserWindow : function ()
{
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator);

Expand Down Expand Up @@ -1138,7 +1147,7 @@ GeolocationPrompt.prototype = {

QueryInterface: XPCOMUtils.generateQI([Ci.nsIGeolocationPrompt]),

prompt: function GP_prompt(request) {
prompt: function(request) {
var pm = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager);

var result = pm.testExactPermission(request.requestingURI, "geo");
Expand Down

0 comments on commit a150da6

Please sign in to comment.