mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 691647 Part 2: remove Firefox Desktop implementation of removed nsISidebar methods. r=dolske
--HG-- extra : rebase_source : 7981dd516a4098d7ebc85b9c406163d30d4ebac3
This commit is contained in:
parent
96ec4237c9
commit
76f9ea5129
@ -23,62 +23,6 @@ function nsSidebar()
|
||||
|
||||
nsSidebar.prototype.classID = SIDEBAR_CID;
|
||||
|
||||
nsSidebar.prototype.nc = "http://home.netscape.com/NC-rdf#";
|
||||
|
||||
function sidebarURLSecurityCheck(url)
|
||||
{
|
||||
if (!/^(https?:|ftp:)/i.test(url)) {
|
||||
Components.utils.reportError("Invalid argument passed to window.sidebar.addPanel: Unsupported panel URL." );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 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)
|
||||
{
|
||||
// XXX Bug 620418: We shouldn't do this anymore. Instead, we should find the
|
||||
// global object for our caller and use it.
|
||||
var win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!sidebarURLSecurityCheck(aContentURL))
|
||||
return;
|
||||
|
||||
var uri = null;
|
||||
try {
|
||||
uri = Services.io.newURI(aContentURL, null, null);
|
||||
}
|
||||
catch(ex) { return; }
|
||||
|
||||
win.PlacesUIUtils.showBookmarkDialog({ action: "add"
|
||||
, type: "bookmark"
|
||||
, hiddenRows: [ "description"
|
||||
, "keyword"
|
||||
, "location" ]
|
||||
, uri: uri
|
||||
, title: aTitle
|
||||
, loadBookmarkInSidebar: true
|
||||
}, win);
|
||||
}
|
||||
|
||||
nsSidebar.prototype.validateSearchEngine =
|
||||
function (engineURL, iconURL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user