Commit 7fbf3c95 authored by Marco Bonardo's avatar Marco Bonardo
Browse files

Bug 1167237 - Remove nsIBrowserGlue.sanitize() and nsIBrowserGlue. r=johannh

MozReview-Commit-ID: DPs8n6OTfDh

--HG--
extra : rebase_source : eb6fb1fcbafd5630b838404dde48b1ed0f3f2c36
parent 9b5cffb9
......@@ -98,8 +98,7 @@
<command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
<command id="Tools:Sanitize"
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
<command id="Tools:Sanitize" oncommand="Sanitizer.showUI(window);"/>
<command id="Tools:PrivateBrowsing"
oncommand="OpenBrowserWindow({private: true});"/>
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
......
......@@ -50,6 +50,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
ReaderParent: "resource:///modules/ReaderParent.jsm",
RecentWindow: "resource:///modules/RecentWindow.jsm",
SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
Sanitizer: "resource:///modules/Sanitizer.jsm",
SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
SchedulePressure: "resource:///modules/SchedulePressure.jsm",
ShortcutUtils: "resource://gre/modules/ShortcutUtils.jsm",
......
......@@ -59,7 +59,6 @@ DIRS += [
DIRS += ['build']
XPIDL_SOURCES += [
'nsIBrowserGlue.idl',
'nsIBrowserHandler.idl',
]
......
......@@ -225,18 +225,11 @@ const LATE_TASKS_IDLE_TIME_SEC = 20;
// Time after we stop tracking startup crashes.
const STARTUP_CRASHES_END_DELAY_MS = 30 * 1000;
// Factory object
const BrowserGlueServiceFactory = {
_instance: null,
createInstance: function BGSF_createInstance(outer, iid) {
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return this._instance == null ?
this._instance = new BrowserGlue() : this._instance;
}
};
// Constructor
/*
* OS X has the concept of zero-window sessions and therefore ignores the
* browser-lastwindow-close-* topics.
*/
const OBSERVE_LASTWINDOW_CLOSE_TOPICS = AppConstants.platform != "macosx";
function BrowserGlue() {
XPCOMUtils.defineLazyServiceGetter(this, "_idleService",
......@@ -254,12 +247,6 @@ function BrowserGlue() {
this._init();
}
/*
* OS X has the concept of zero-window sessions and therefore ignores the
* browser-lastwindow-close-* topics.
*/
const OBSERVE_LASTWINDOW_CLOSE_TOPICS = AppConstants.platform != "macosx";
BrowserGlue.prototype = {
_saveSession: false,
_migrationImportsDefaultBookmarks: false,
......@@ -2387,14 +2374,6 @@ BrowserGlue.prototype = {
// leave it at its current value.
},
// ------------------------------
// public nsIBrowserGlue members
// ------------------------------
sanitize: function BG_sanitize(aParentWindow) {
Sanitizer.showUI(aParentWindow);
},
async ensurePlacesDefaultQueriesInitialized() {
// This is the current smart bookmarks version, it must be increased every
// time they change.
......@@ -2757,11 +2736,9 @@ BrowserGlue.prototype = {
classID: Components.ID("{eab9012e-5f74-4cbc-b2b5-a590235513cc}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsIBrowserGlue]),
Ci.nsISupportsWeakReference]),
// redefine the default factory for XPCOMUtils
_xpcom_factory: BrowserGlueServiceFactory,
_xpcom_factory: XPCOMUtils.generateSingletonFactory(BrowserGlue),
};
/**
......
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
interface nsIDOMWindow;
/**
* nsIBrowserGlue is a dirty and rather fluid interface to host shared utility
* methods used by browser UI code, but which are not local to a browser window.
* The component implementing this interface is meant to be a singleton
* (service) and should progressively replace some of the shared "glue" code
* scattered in browser/base/content (e.g. bits of utilOverlay.js,
* contentAreaUtils.js, globalOverlay.js, browser.js), avoiding dynamic
* inclusion and initialization of a ton of JS code for *each* window.
* Dued to its nature and origin, this interface won't probably be the most
* elegant or stable in the mozilla codebase, but its aim is rather pragmatic:
* 1) reducing the performance overhead which affects browser window load;
* 2) allow global hooks (e.g. startup and shutdown observers) which survive
* browser windows to accomplish browser-related activities, such as shutdown
* sanitization (see bug #284086)
*
*/
[scriptable, uuid(b0e7c156-d00c-4605-a77d-27c7418f23ae)]
interface nsIBrowserGlue : nsISupports
{
/**
* Deletes privacy sensitive data according to user preferences
*
* @param aParentWindow an optionally null window which is the parent of the
* sanitization dialog
*
*/
void sanitize(in nsIDOMWindow aParentWindow);
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment