Browse Source

[Navigator] Change most Contract IDs

custom-2020
Matt A. Tobin 2 years ago committed by Roy Tam
parent
commit
c3ee88865f
  1. 12
      navigator/base/content/navigator.js
  2. 2
      navigator/base/content/navigatorOverlay.xul
  3. 2
      navigator/base/content/tabbrowser.xml
  4. 4
      navigator/comm/content/nsContextMenu.js
  5. 2
      navigator/comm/locale/quitDialog.properties
  6. 12
      navigator/components/NavigatorComponents.manifest
  7. 2
      navigator/components/dirprovider/src/nsSuiteDirectoryProvider.h
  8. 2
      navigator/components/feeds/src/FeedConverter.js
  9. 2
      navigator/components/feeds/src/FeedWriter.js
  10. 4
      navigator/components/moz.build
  11. 4
      navigator/components/nsBrowserContentHandler.js
  12. 4
      navigator/components/nsINavigatorGlue.idl
  13. 13
      navigator/components/nsNavigatorGlue.js
  14. 352
      navigator/components/nsSidebar.js
  15. 4
      navigator/components/preferences/content/pref-applications.js
  16. 8
      navigator/components/preferences/content/pref-navigator.js
  17. 4
      navigator/components/preferences/content/pref-privatedata.js
  18. 6
      navigator/components/sessionstore/SessionStore.manifest
  19. 6
      navigator/components/sessionstore/content/aboutSessionRestore.js
  20. 2
      navigator/components/sessionstore/src/nsSessionStore.js
  21. 4
      navigator/components/shell/content/defaultClientDialog.js
  22. 2
      navigator/components/shell/content/setDesktopBackground.js
  23. 4
      navigator/components/shell/nsSetDefault.manifest
  24. 8
      navigator/components/shell/src/nsSetDefault.js
  25. 2
      navigator/components/shell/src/nsShellService.h

12
navigator/base/content/navigator.js

@ -746,7 +746,7 @@ function updateWindowState()
function InitSessionStoreCallback()
{
try {
var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
ss.init(window);
@ -889,7 +889,7 @@ function OpenSessionHistoryIn(aWhere, aDelta, aTab)
{
var win = aWhere == "window" ? null : window;
aTab = aTab || getBrowser().selectedTab;
var tab = Components.classes["@mozilla.org/suite/sessionstore;1"]
var tab = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore)
.duplicateTab(win, aTab, aDelta, true);
@ -1504,7 +1504,7 @@ function updateCloseItems()
function updateRecentMenuItems()
{
var browser = getBrowser();
var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
var recentTabsItem = document.getElementById("menu_recentTabs");
@ -1540,7 +1540,7 @@ function updateRecentTabs(menupopup)
function updateRecentWindows(menupopup)
{
var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
while (menupopup.hasChildNodes())
@ -1566,14 +1566,14 @@ function updateRecentWindows(menupopup)
function undoCloseWindow(aIndex)
{
var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
return ss.undoCloseWindow(aIndex);
}
function restoreLastSession() {
let ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
let ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
ss.restoreLastSession();
}

2
navigator/base/content/navigatorOverlay.xul

@ -201,7 +201,7 @@
<!-- Tools Menu -->
<command id="Tools:Sanitize"
oncommand="Components.classes['@mozilla.org/suite/suiteglue;1'].getService(Components.interfaces.nsISuiteGlue).sanitize(window);"/>
oncommand="Components.classes['@binaryoutcast.com/navigator/navigatorglue;1'].getService(Components.interfaces.nsINavigatorGlue).sanitize(window);"/>
</commandset>

2
navigator/base/content/tabbrowser.xml

@ -100,7 +100,7 @@
</content>
<implementation implements="nsIObserver">
<field name="mSessionStore" readonly="true">
Components.classes["@mozilla.org/suite/sessionstore;1"]
Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
</field>
<field name="mPrefs" readonly="true">

4
navigator/comm/content/nsContextMenu.js

@ -226,9 +226,9 @@ nsContextMenu.prototype = {
// Set Desktop Background depends on whether an image was clicked on,
// and requires the shell service.
var canSetDesktopBackground = false;
if ("@mozilla.org/suite/shell-service;1" in Components.classes) try {
if ("@binaryoutcast.com/navigator/shell-service;1" in Components.classes) try {
canSetDesktopBackground =
Components.classes["@mozilla.org/suite/shell-service;1"]
Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(Components.interfaces.nsIShellService)
.canSetDesktopBackground;
} catch (e) {

2
navigator/comm/locale/quitDialog.properties

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Strings for the Quit, Restart, and Close-browser dialogs
# used by _onQuitRequest() in nsSuiteGlue.js
# used by _onQuitRequest() in nsNavigatorGlue.js
# LOCALIZATION NOTE:
# %S (also in the messages further down)

12
navigator/components/NavigatorComponents.manifest

@ -33,12 +33,12 @@ component {22042bdb-56e4-47c6-8b12-fdfa859c05a9} nsGopherProtocolStubHandler.js
contract @mozilla.org/network/protocol;1?name=gopher {22042bdb-56e4-47c6-8b12-fdfa859c05a9}
component {45c8f75b-a299-4178-a461-f63690389055} nsTypeAheadFind.js
contract @mozilla.org/suite/typeaheadfind;1 {45c8f75b-a299-4178-a461-f63690389055}
category app-startup SuiteTypeAheadFind service,@mozilla.org/suite/typeaheadfind;1
contract @binaryoutcast.com/navigator/typeaheadfind;1 {45c8f75b-a299-4178-a461-f63690389055}
category app-startup SuiteTypeAheadFind service,@binaryoutcast.com/navigator/typeaheadfind;1
component {bbbbe845-5a1b-40ee-813c-f84b8faaa07c} nsSuiteGlue.js
contract @mozilla.org/suite/suiteglue;1 {bbbbe845-5a1b-40ee-813c-f84b8faaa07c}
category app-startup nsSuiteGlue service,@mozilla.org/suite/suiteglue;1
component {9d4c845d-3f09-402a-b66d-50f291d7d50f} nsSuiteGlue.js
component {bbbbe845-5a1b-40ee-813c-f84b8faaa07c} nsNavigatorGlue.js
contract @binaryoutcast.com/navigator/navigatorglue;1 {bbbbe845-5a1b-40ee-813c-f84b8faaa07c}
category app-startup nsNavigatorGlue service,@binaryoutcast.com/navigator/navigatorglue;1
component {9d4c845d-3f09-402a-b66d-50f291d7d50f} nsNavigatorGlue.js
contract @mozilla.org/content-permission/prompt;1 {9d4c845d-3f09-402a-b66d-50f291d7d50f}

2
navigator/components/dirprovider/src/nsSuiteDirectoryProvider.h

@ -14,7 +14,7 @@
#include "nsIProperties.h"
#include "mozilla/Attributes.h"
#define NS_SUITEDIRECTORYPROVIDER_CONTRACTID "@mozilla.org/suite/directory-provider;1"
#define NS_SUITEDIRECTORYPROVIDER_CONTRACTID "@binaryoutcast.com/navigator/directory-provider;1"
// {9aa21826-9d1d-433d-8c10-f313b26fa9dd}
#define NS_SUITEDIRECTORYPROVIDER_CID \
{ 0x9aa21826, 0x9d1d, 0x433d, { 0x8c, 0x10, 0xf3, 0x13, 0xb2, 0x6f, 0xa9, 0xdd } }

2
navigator/components/feeds/src/FeedConverter.js

@ -383,7 +383,7 @@ FeedResultService.prototype = {
// Retrieving the shell service might fail on some systems, most
// notably systems where GNOME is not installed.
try {
var ss = Components.classes["@mozilla.org/suite/shell-service;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(Components.interfaces.nsIShellService);
ss.openApplicationWithURI(clientApp, spec);
} catch(e) {

2
navigator/components/feeds/src/FeedWriter.js

@ -835,7 +835,7 @@ FeedWriter.prototype = {
// List the default feed reader
try {
this._defaultSystemReader = Components.classes["@mozilla.org/suite/shell-service;1"]
this._defaultSystemReader = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(Components.interfaces.nsIShellService)
.defaultFeedReader;
menuItem = liveBookmarksMenuItem.cloneNode(false);

4
navigator/components/moz.build

@ -22,7 +22,7 @@ DIRS += [
]
XPIDL_SOURCES += [
'nsISuiteGlue.idl',
'nsINavigatorGlue.idl',
]
XPIDL_MODULE = 'navigatorcompsbase'
@ -32,6 +32,6 @@ EXTRA_COMPONENTS += [
'nsAboutRedirector.js',
'nsBrowserContentHandler.js',
'nsGopherProtocolStubHandler.js',
'nsSuiteGlue.js',
'nsNavigatorGlue.js',
'nsTypeAheadFind.js',
]

4
navigator/components/nsBrowserContentHandler.js

@ -129,7 +129,7 @@ function getURLToLoad()
}
try {
var ss = Components.classes["@mozilla.org/suite/sessionstartup;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstartup;1"]
.getService(Components.interfaces.nsISessionStartup);
// return about:blank if we are restoring previous session
if (ss.doRestore())
@ -138,7 +138,7 @@ function getURLToLoad()
}
try {
var st = Components.classes["@mozilla.org/suite/sessionstore;1"]
var st = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"]
.getService(Components.interfaces.nsISessionStore);
// return about:blank if the last window was closed and should be restored
if (st.doRestoreLastWindow())

4
navigator/components/nsISuiteGlue.idl → navigator/components/nsINavigatorGlue.idl

@ -8,7 +8,7 @@ interface nsIDOMWindow;
/**
* ***** this is the suite version of nsIBrowserGlue *****
* nsISuiteGlue is a dirty and rather fluid interface to host shared utility
* nsINavigatorGlue is a dirty and rather fluid interface to host shared utility
* methods used by suite UI code, but which are not local to a suite window.
* The component implementing this interface is meant to be a singleton
* (service) and should progressively replace some of the shared "glue" code
@ -24,7 +24,7 @@ interface nsIDOMWindow;
*/
[scriptable, uuid(2559bb36-2eef-4190-9df1-8afcfbd35bd3)]
interface nsISuiteGlue : nsISupports
interface nsINavigatorGlue : nsISupports
{
/**
* Deletes privacy sensitive data according to user preferences

13
navigator/components/nsSuiteGlue.js → navigator/components/nsNavigatorGlue.js

@ -47,7 +47,7 @@ const BOOKMARKS_BACKUP_INTERVAL = 86400 * 1000;
const BOOKMARKS_BACKUP_MAX_BACKUPS = 10;
// Constructor
function SuiteGlue() {
function NavigatorGlue() {
XPCOMUtils.defineLazyServiceGetter(this, "_idleService",
"@mozilla.org/widget/idleservice;1",
"nsIIdleService");
@ -55,7 +55,7 @@ function SuiteGlue() {
this._init();
}
SuiteGlue.prototype = {
NavigatorGlue.prototype = {
_saveSession: false,
_sound: null,
_isIdleObserver: false,
@ -559,6 +559,7 @@ SuiteGlue.prototype = {
if (this._isPlacesDatabaseLocked)
notifyBox.showPlacesLockedWarning();
#ifdef MOZ_UPDATER
// Detect if updates are off and warn for outdated builds.
if (this._shouldShowUpdateWarning())
notifyBox.showUpdateWarning();
@ -820,7 +821,7 @@ SuiteGlue.prototype = {
// This will do nothing on platforms without a shell service.
_checkForDefaultClient: function checkForDefaultClient(aWindow)
{
const NS_SHELLSERVICE_CID = "@mozilla.org/suite/shell-service;1";
const NS_SHELLSERVICE_CID = "@binaryoutcast.com/navigator/shell-service;1";
if (NS_SHELLSERVICE_CID in Components.classes) try {
var nsIShellService = Components.interfaces.nsIShellService;
@ -1142,7 +1143,7 @@ SuiteGlue.prototype = {
},
// ------------------------------
// public nsISuiteGlue members
// public nsINavigatorGlue members
// ------------------------------
sanitize: function(aParentWindow)
@ -1328,7 +1329,7 @@ SuiteGlue.prototype = {
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver,
Components.interfaces.nsIWebProgressListener,
Components.interfaces.nsISupportsWeakReference,
Components.interfaces.nsISuiteGlue])
Components.interfaces.nsINavigatorGlue])
}
@ -1412,4 +1413,4 @@ ContentPermissionPrompt.prototype = {
};
//module initialization
var NSGetFactory = XPCOMUtils.generateNSGetFactory([SuiteGlue, ContentPermissionPrompt]);
var NSGetFactory = XPCOMUtils.generateNSGetFactory([NavigatorGlue, ContentPermissionPrompt]);

352
navigator/components/nsSidebar.js

@ -1,352 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* 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/. */
/*
* No magic constructor behaviour, as is de rigeur for XPCOM.
* If you must perform some initialization, and it could possibly fail (even
* due to an out-of-memory condition), you should use an Init method, which
* can convey failure appropriately (thrown exception in JS,
* NS_FAILED(nsresult) return in C++).
*
* In JS, you can actually cheat, because a thrown exception will cause the
* CreateInstance call to fail in turn, but not all languages are so lucky.
* (Though ANSI C++ provides exceptions, they are verboten in Mozilla code
* for portability reasons -- and even when you're building completely
* platform-specific code, you can't throw across an XPCOM method boundary.)
*/
const DEBUG = false; /* set to false to suppress debug messages */
const PANELS_RDF_FILE = "UPnls"; /* directory services property to find panels.rdf */
const SIDEBAR_CONTRACTID = "@mozilla.org/sidebar;1";
const SIDEBAR_CID = Components.ID("{22117140-9c6e-11d3-aaf1-00805f8a4905}");
const CONTAINER_CONTRACTID = "@mozilla.org/rdf/container;1";
const NETSEARCH_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=internetsearch"
const nsISupports = Components.interfaces.nsISupports;
const nsISidebar = Components.interfaces.nsISidebar;
const nsIRDFContainer = Components.interfaces.nsIRDFContainer;
const nsIProperties = Components.interfaces.nsIProperties;
const nsIFileURL = Components.interfaces.nsIFileURL;
const nsIRDFRemoteDataSource = Components.interfaces.nsIRDFRemoteDataSource;
const nsIClassInfo = Components.interfaces.nsIClassInfo;
// File extension for Sherlock search plugin description files
const SHERLOCK_FILE_EXT_REGEXP = /\.src$/i;
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
function nsSidebar()
{
const RDF_CONTRACTID = "@mozilla.org/rdf/rdf-service;1";
const nsIRDFService = Components.interfaces.nsIRDFService;
this.rdf = Components.classes[RDF_CONTRACTID].getService(nsIRDFService);
this.datasource_uri = getSidebarDatasourceURI(PANELS_RDF_FILE);
debug('datasource_uri is ' + this.datasource_uri);
this.resource = 'urn:sidebar:current-panel-list';
this.datasource = this.rdf.GetDataSource(this.datasource_uri);
}
nsSidebar.prototype.nc = "http://home.netscape.com/NC-rdf#";
nsSidebar.prototype.isPanel =
function (aContentURL)
{
var container =
Components.classes[CONTAINER_CONTRACTID].createInstance(nsIRDFContainer);
container.Init(this.datasource, this.rdf.GetResource(this.resource));
/* Create a resource for the new panel and add it to the list */
var panel_resource =
this.rdf.GetResource("urn:sidebar:3rdparty-panel:" + aContentURL);
return (container.IndexOf(panel_resource) != -1);
}
function sidebarURLSecurityCheck(url)
{
if (!/(^http:|^ftp:|^https:)/i.test(url))
throw "Script attempted to add sidebar panel from illegal source";
}
/* decorate prototype to provide ``class'' methods and property accessors */
nsSidebar.prototype.addPanel =
function (aTitle, aContentURL, aCustomizeURL)
{
debug("addPanel(" + aTitle + ", " + aContentURL + ", " +
aCustomizeURL + ")");
return this.addPanelInternal(aTitle, aContentURL, aCustomizeURL, false);
}
nsSidebar.prototype.addPersistentPanel =
function(aTitle, aContentURL, aCustomizeURL)
{
debug("addPersistentPanel(" + aTitle + ", " + aContentURL + ", " +
aCustomizeURL + ")\n");
return this.addPanelInternal(aTitle, aContentURL, aCustomizeURL, true);
}
nsSidebar.prototype.addPanelInternal =
function (aTitle, aContentURL, aCustomizeURL, aPersist)
{
sidebarURLSecurityCheck(aContentURL);
// Create a "container" wrapper around the current panels to
// manipulate the RDF:Seq more easily.
var panel_list = this.datasource.GetTarget(this.rdf.GetResource(this.resource), this.rdf.GetResource(nsSidebar.prototype.nc+"panel-list"), true);
if (panel_list) {
panel_list.QueryInterface(Components.interfaces.nsIRDFResource);
} else {
// Datasource is busted. Start over.
debug("Sidebar datasource is busted\n");
}
var container = Components.classes[CONTAINER_CONTRACTID].createInstance(nsIRDFContainer);
container.Init(this.datasource, panel_list);
/* Create a resource for the new panel and add it to the list */
var panel_resource =
this.rdf.GetResource("urn:sidebar:3rdparty-panel:" + aContentURL);
var panel_index = container.IndexOf(panel_resource);
var stringBundle, brandStringBundle, titleMessage, dialogMessage;
if (panel_index != -1)
{
try {
stringBundle = Services.strings.createBundle("chrome://communicator/locale/sidebar/sidebar.properties");
brandStringBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
if (stringBundle) {
sidebarName = brandStringBundle.GetStringFromName("sidebarName");
titleMessage = stringBundle.GetStringFromName("dupePanelAlertTitle");
dialogMessage = stringBundle.GetStringFromName("dupePanelAlertMessage");
dialogMessage = dialogMessage.replace(/%url%/, aContentURL);
dialogMessage = dialogMessage.replace(/%name%/, sidebarName);
}
}
catch (e) {
titleMessage = "Sidebar";
dialogMessage = aContentURL + " already exists in Sidebar. No string bundle";
}
Services.prompt.alert(null, titleMessage, dialogMessage);
return;
}
try {
stringBundle = Services.strings.createBundle("chrome://communicator/locale/sidebar/sidebar.properties");
brandStringBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
if (stringBundle) {
sidebarName = brandStringBundle.GetStringFromName("sidebarName");
titleMessage = stringBundle.GetStringFromName("addPanelConfirmTitle");
dialogMessage = stringBundle.GetStringFromName("addPanelConfirmMessage");
if (aPersist)
{
var warning = stringBundle.GetStringFromName("persistentPanelWarning");
dialogMessage += "\n" + warning;
}
dialogMessage = dialogMessage.replace(/%title%/, aTitle);
dialogMessage = dialogMessage.replace(/%url%/, aContentURL);
dialogMessage = dialogMessage.replace(/#/g, "\n");
dialogMessage = dialogMessage.replace(/%name%/g, sidebarName);
}
}
catch (e) {
titleMessage = "Add Tab to Sidebar";
dialogMessage = "No string bundle. Add the Tab '" + aTitle + "' to Sidebar?\n\n" + "Source: " + aContentURL;
}
var rv = Services.prompt.confirm(null, titleMessage, dialogMessage);
if (!rv)
return;
/* Now make some sidebar-ish assertions about it... */
this.datasource.Assert(panel_resource,
this.rdf.GetResource(this.nc + "title"),
this.rdf.GetLiteral(aTitle),
true);
this.datasource.Assert(panel_resource,
this.rdf.GetResource(this.nc + "content"),
this.rdf.GetLiteral(aContentURL),
true);
if (aCustomizeURL)
this.datasource.Assert(panel_resource,
this.rdf.GetResource(this.nc + "customize"),
this.rdf.GetLiteral(aCustomizeURL),
true);
var persistValue = aPersist ? "true" : "false";
this.datasource.Assert(panel_resource,
this.rdf.GetResource(this.nc + "persist"),
this.rdf.GetLiteral(persistValue),
true);
container.AppendElement(panel_resource);
// Use an assertion to pass a "refresh" event to all the sidebars.
// They use observers to watch for this assertion (in sidebarOverlay.js).
this.datasource.Assert(this.rdf.GetResource(this.resource),
this.rdf.GetResource(this.nc + "refresh"),
this.rdf.GetLiteral("true"),
true);
this.datasource.Unassert(this.rdf.GetResource(this.resource),
this.rdf.GetResource(this.nc + "refresh"),
this.rdf.GetLiteral("true"));
/* Write the modified panels out. */
this.datasource.QueryInterface(nsIRDFRemoteDataSource).Flush();
}
nsSidebar.prototype.validateSearchEngine =
function (engineURL, iconURL)
{
try
{
// Make sure the URLs are HTTP, HTTPS, or FTP.
var isWeb = /^(https?|ftp):\/\//i;
if (!isWeb.test(engineURL))
throw "Unsupported search engine URL";
if (iconURL && !isWeb.test(iconURL))
throw "Unsupported search icon URL.";
}
catch(ex)
{
debug(ex);
Components.utils.reportError("Invalid argument passed to window.sidebar.addSearchEngine: " + ex);
var searchBundle = Services.strings.createBundle("chrome://global/locale/search/search.properties");
var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
var brandName = brandBundle.GetStringFromName("brandShortName");
var title = searchBundle.GetStringFromName("error_invalid_engine_title");
var msg = searchBundle.formatStringFromName("error_invalid_engine_msg",
[brandName], 1);
Services.ww.getNewPrompter(null).alert(title, msg);
return false;
}
return true;
}
// The suggestedTitle and suggestedCategory parameters are ignored, but remain
// for backward compatibility.
nsSidebar.prototype.addSearchEngine =
function (engineURL, iconURL, suggestedTitle, suggestedCategory)
{
debug("addSearchEngine(" + engineURL + ", " + iconURL + ", " +
suggestedCategory + ", " + suggestedTitle + ")");
if (!this.validateSearchEngine(engineURL, iconURL))
return;
// OpenSearch files will likely be far more common than Sherlock files, and
// have less consistent suffixes, so we assume that ".src" is a Sherlock
// (text) file, and anything else is OpenSearch (XML).
var dataType;
if (SHERLOCK_FILE_EXT_REGEXP.test(engineURL))
dataType = Components.interfaces.nsISearchEngine.DATA_TEXT;
else
dataType = Components.interfaces.nsISearchEngine.DATA_XML;
Services.search.addEngine(engineURL, dataType, iconURL, true);
}
// This function exists largely to implement window.external.AddSearchProvider(),
// to match other browsers' APIs. The capitalization, although nonstandard here,
// is therefore important.
nsSidebar.prototype.AddSearchProvider =
function (aDescriptionURL)
{
// Get the favicon URL for the current page, or our best guess at the current
// page since we don't have easy access to the active document. Most search
// engines will override this with an icon specified in the OpenSearch
// description anyway.
var win = Services.wm.getMostRecentWindow("navigator:browser");
var browser = win.getBrowser();
var iconURL = "";
// Use documentURIObject in the check for shouldLoadFavIcon so that we
// do the right thing with about:-style error pages. Bug 453442
if (browser.shouldLoadFavIcon(browser.selectedBrowser
.contentDocument
.documentURIObject))
iconURL = browser.getIcon();
if (!this.validateSearchEngine(aDescriptionURL, iconURL))
return;
const typeXML = Components.interfaces.nsISearchEngine.DATA_XML;
Services.search.addEngine(aDescriptionURL, typeXML, iconURL, true);
}
// This function exists to implement window.external.IsSearchProviderInstalled(),
// for compatibility with other browsers. It will return an integer value
// indicating whether the given engine is installed for the current user.
// However, it is currently stubbed out due to security/privacy concerns
// stemming from difficulties in determining what domain issued the request.
// See bug 340604 and
// http://msdn.microsoft.com/en-us/library/aa342526%28VS.85%29.aspx .
// XXX Implement this!
nsSidebar.prototype.IsSearchProviderInstalled =
function (aSearchURL)
{
return 0;
}
nsSidebar.prototype.classInfo = XPCOMUtils.generateCI({
classID: SIDEBAR_CID,
contractID: SIDEBAR_CONTRACTID,
classDescription: "Sidebar",
interfaces: [nsISidebar],
flags: nsIClassInfo.DOM_OBJECT});
nsSidebar.prototype.QueryInterface =
XPCOMUtils.generateQI([nsISidebar]);
nsSidebar.prototype.classID = SIDEBAR_CID;
var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]);
/* static functions */
if (DEBUG)
debug = function (s) { dump("-*- sidebar component: " + s + "\n"); }
else
debug = function (s) {}
function getSidebarDatasourceURI(panels_file_id)
{
try
{
/* use the fileLocator to look in the profile directory
* to find 'panels.rdf', which is the
* database of the user's currently selected panels.
* if <profile>/panels.rdf doesn't exist, get will copy
*bin/defaults/profile/panels.rdf to <profile>/panels.rdf */
var sidebar_file = Services.dirsvc.get(panels_file_id,
Components.interfaces.nsIFile);
if (!sidebar_file.exists())
{
/* this should not happen, as GetFileLocation() should copy
* defaults/panels.rdf to the users profile directory */
debug("sidebar file does not exist");
return null;
}
var file_handler = Services.io.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler);
var sidebar_uri = file_handler.getURLSpecFromFile(sidebar_file);
debug("sidebar uri is " + sidebar_uri);
return sidebar_uri;
}
catch (ex)
{
/* this should not happen */
debug("caught " + ex + " getting sidebar datasource uri");
return null;
}
}

4
navigator/components/preferences/content/pref-applications.js

@ -32,8 +32,8 @@ var mimeSvc = Components.classes["@mozilla.org/mime;1"]
var converterSvc = Components.classes["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"]
.getService(Components.interfaces.nsIWebContentConverterService);
var shellSvc = null;
if ("@mozilla.org/suite/shell-service;1" in Components.classes)
shellSvc = Components.classes["@mozilla.org/suite/shell-service;1"]
if ("@binaryoutcast.com/navigator/shell-service;1" in Components.classes)
shellSvc = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(Components.interfaces.nsIShellService);
const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";

8
navigator/components/preferences/content/pref-navigator.js

@ -265,7 +265,7 @@ function WriteConcurrentTabs()
function ApplySetAsDefaultBrowser()
{
const nsIShellService = Components.interfaces.nsIShellService;
var shellSvc = Components.classes["@mozilla.org/suite/shell-service;1"]
var shellSvc = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
shellSvc.setDefaultClient(false, false, nsIShellService.BROWSER);
@ -275,7 +275,7 @@ function ApplySetAsDefaultBrowser()
function IsDefaultBrowser()
{
const nsIShellService = Components.interfaces.nsIShellService;
var shellSvc = Components.classes["@mozilla.org/suite/shell-service;1"]
var shellSvc = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
return shellSvc.isDefaultClient(false, nsIShellService.BROWSER);
@ -283,7 +283,7 @@ function IsDefaultBrowser()
function InitPlatformIntegration()
{
const NS_SHELLSERVICE_CID = "@mozilla.org/suite/shell-service;1";
const NS_SHELLSERVICE_CID = "@binaryoutcast.com/navigator/shell-service;1";
if (NS_SHELLSERVICE_CID in Components.classes) try {
var desc = document.getElementById("defaultBrowserDesc");
@ -323,7 +323,7 @@ function SetAsDefaultBrowser()
function ShellServiceCheck()
{
const NS_SHELLSERVICE_CID = "@mozilla.org/suite/shell-service;1";
const NS_SHELLSERVICE_CID = "@binaryoutcast.com/navigator/shell-service;1";
if (NS_SHELLSERVICE_CID in Components.classes) try {
Components.classes[NS_SHELLSERVICE_CID]

4
navigator/components/preferences/content/pref-privatedata.js

@ -34,7 +34,7 @@ function updateClearNowButtonLabel()
*/
function clearPrivateDataNow()
{
Components.classes["@mozilla.org/suite/suiteglue;1"]
.getService(Components.interfaces.nsISuiteGlue)
Components.classes["@binaryoutcast.com/navigator/navigatorglue;1"]
.getService(Components.interfaces.nsINavigatorGlue)
.sanitize(window);
}

6
navigator/components/sessionstore/SessionStore.manifest

@ -1,6 +1,6 @@
component {4e6c1112-57b6-44ba-adf9-99fb573b0a30} nsSessionStartup.js
contract @mozilla.org/suite/sessionstartup;1 {4e6c1112-57b6-44ba-adf9-99fb573b0a30}
category app-startup SessionStartup service,@mozilla.org/suite/sessionstartup;1
contract @binaryoutcast.com/navigator/sessionstartup;1 {4e6c1112-57b6-44ba-adf9-99fb573b0a30}
category app-startup SessionStartup service,@binaryoutcast.com/navigator/sessionstartup;1
component {d37ccdf1-496f-4135-9575-037180af010d} nsSessionStore.js
contract @mozilla.org/suite/sessionstore;1 {d37ccdf1-496f-4135-9575-037180af010d}
contract @binaryoutcast.com/navigator/sessionstore;1 {d37ccdf1-496f-4135-9575-037180af010d}

6
navigator/components/sessionstore/content/aboutSessionRestore.js

@ -25,7 +25,7 @@ window.onload = function() {
// (for when the tab is closed or the session crashes right again)
var sessionData = document.getElementById("sessionData");
if (!sessionData.value) {
var ss = Components.classes["@mozilla.org/suite/sessionstartup;1"].getService(Components.interfaces.nsISessionStartup);
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstartup;1"].getService(Components.interfaces.nsISessionStartup);
sessionData.value = ss.state;
if (!sessionData.value) {
document.getElementById("errorTryAgain").disabled = true;
@ -99,7 +99,7 @@ function restoreSession() {
}
var stateString = JSON.stringify(gStateObject);
var ss = Components.classes["@mozilla.org/suite/sessionstore;1"].getService(Components.interfaces.nsISessionStore);
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"].getService(Components.interfaces.nsISessionStore);
var top = getBrowserWindow();
// if there's only this page open, reuse the window for restoring the session
@ -196,7 +196,7 @@ function restoreSingleTab(aIx, aShifted) {
var newTab = tabbrowser.addTab();
var item = gTreeData[aIx];
var ss = Components.classes["@mozilla.org/suite/sessionstore;1"].getService(Components.interfaces.nsISessionStore);
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstore;1"].getService(Components.interfaces.nsISessionStore);
var tabState = gStateObject.windows[item.parent.ix]
.tabs[aIx - gTreeData.indexOf(item.parent) - 1];
ss.setTabState(newTab, JSON.stringify(tabState));

2
navigator/components/sessionstore/src/nsSessionStore.js

@ -224,7 +224,7 @@ SessionStoreService.prototype = {
this._sessionFileBackup.append("sessionstore.bak");
// get string containing session state
var ss = Components.classes["@mozilla.org/suite/sessionstartup;1"]
var ss = Components.classes["@binaryoutcast.com/navigator/sessionstartup;1"]
.getService(Components.interfaces.nsISessionStartup);
try {
if (ss.sessionType != Components.interfaces.nsISessionStartup.NO_SESSION)

4
navigator/components/shell/content/defaultClientDialog.js

@ -9,7 +9,7 @@ const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
function onLoad()
{
var shellSvc = Components.classes["@mozilla.org/suite/shell-service;1"]
var shellSvc = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
var defaultList = document.getElementById("defaultList");
var appTypes = shellSvc.shouldBeDefaultClientFor;
@ -34,7 +34,7 @@ function onLoad()
function onAccept()
{
// for each checked item, if we aren't already the default, make us the default.
var shellSvc = Components.classes["@mozilla.org/suite/shell-service;1"]
var shellSvc = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
var appTypes = 0;
var appTypesCheck = 0;

2
navigator/components/shell/content/setDesktopBackground.js

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const nsIShellService = Components.interfaces.nsIShellService;
var gShell = Components.classes["@mozilla.org/suite/shell-service;1"]
var gShell = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
var gImage, gPosition, gPicker, gDesktop;

4
navigator/components/shell/nsSetDefault.manifest

@ -1,3 +1,3 @@
component {a3d5b950-690a-491f-a881-2c2cdcd241cb} nsSetDefault.js
contract @mozilla.org/suite/default-browser-clh;1 {a3d5b950-690a-491f-a881-2c2cdcd241cb}
category command-line-handler m-setdefault @mozilla.org/suite/default-browser-clh;1
contract @binaryoutcast.com/navigator/default-browser-clh;1 {a3d5b950-690a-491f-a881-2c2cdcd241cb}
category command-line-handler m-setdefault @binaryoutcast.com/navigator/default-browser-clh;1

8
navigator/components/shell/src/nsSetDefault.js

@ -20,22 +20,22 @@ function nsSetDefault() {
nsSetDefault.prototype = {
handle: function nsSetDefault_handle(aCmdline) {
if (aCmdline.handleFlag("setDefaultBrowser", false)) {
var shell = Components.classes["@mozilla.org/suite/shell-service;1"]
var shell = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
shell.setDefaultClient(true, true, nsIShellService.BROWSER);
}
else if (aCmdline.handleFlag("setDefaultMail", false)) {
var shell = Components.classes["@mozilla.org/suite/shell-service;1"]
var shell = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
shell.setDefaultClient(true, true, nsIShellService.MAIL);
}
else if (aCmdline.handleFlag("setDefaultNews", false)) {
var shell = Components.classes["@mozilla.org/suite/shell-service;1"]
var shell = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
shell.setDefaultClient(true, true, nsIShellService.NEWS);
}
else if (aCmdline.handleFlag("setDefaultFeed", false)) {
var shell = Components.classes["@mozilla.org/suite/shell-service;1"]
var shell = Components.classes["@binaryoutcast.com/navigator/shell-service;1"]
.getService(nsIShellService);
shell.setDefaultClient(true, true, nsIShellService.RSS);
}

2
navigator/components/shell/src/nsShellService.h

@ -10,4 +10,4 @@
#define SHELLSERVICE_PROPERTIES "chrome://communicator/locale/shellservice.properties"
#define BRAND_PROPERTIES "chrome://branding/locale/brand.properties"
#define NS_SUITESHELLSERVICE_CONTRACTID "@mozilla.org/suite/shell-service;1"
#define NS_SUITESHELLSERVICE_CONTRACTID "@binaryoutcast.com/navigator/shell-service;1"

Loading…
Cancel
Save