Commit eabb5f64 authored by Shane Caraveo's avatar Shane Caraveo
Browse files

Bug 1215694 move pocket to a system addon, r=Gijs, r=glandium

  part 1: reorganize file locations, r=Gijs
  part 2: remove built-in pocket code, r=Gijs
  part 3: l10n support, r=glandium
  part 4: move code/functionality from part 2 into the addon, r=Gijs
  part 5: remove dead code, r=Gijs
  part 6: create a simple api for addons to add to reader mode, r=Gijs
  part 7: various test fixes related to cui behaviour and pocket, r=me

--HG--
rename : browser/components/pocket/Pocket.jsm => browser/extensions/pocket/content/Pocket.jsm
rename : browser/components/pocket/main.js => browser/extensions/pocket/content/main.js
rename : browser/components/pocket/panels/css/firasans.css => browser/extensions/pocket/content/panels/css/firasans.css
rename : browser/components/pocket/panels/css/normalize.css => browser/extensions/pocket/content/panels/css/normalize.css
rename : browser/components/pocket/panels/css/saved.css => browser/extensions/pocket/content/panels/css/saved.css
rename : browser/components/pocket/panels/css/signup.css => browser/extensions/pocket/content/panels/css/signup.css
rename : browser/components/pocket/panels/fonts/FiraSans-Regular.woff => browser/extensions/pocket/content/panels/fonts/FiraSans-Regular.woff
rename : toolkit/themes/shared/reader/pocket.svg => browser/extensions/pocket/content/panels/img/pocket.svg
rename : browser/components/pocket/panels/img/pocketerror@1x.png => browser/extensions/pocket/content/panels/img/pocketerror@1x.png
rename : browser/components/pocket/panels/img/pocketerror@2x.png => browser/extensions/pocket/content/panels/img/pocketerror@2x.png
rename : browser/components/pocket/panels/img/pocketlogo@1x.png => browser/extensions/pocket/content/panels/img/pocketlogo@1x.png
rename : browser/components/pocket/panels/img/pocketlogo@2x.png => browser/extensions/pocket/content/panels/img/pocketlogo@2x.png
rename : browser/components/pocket/panels/img/pocketlogosolo@1x.png => browser/extensions/pocket/content/panels/img/pocketlogosolo@1x.png
rename : browser/components/pocket/panels/img/pocketlogosolo@2x.png => browser/extensions/pocket/content/panels/img/pocketlogosolo@2x.png
rename : browser/components/pocket/panels/img/pocketmenuitem16.png => browser/extensions/pocket/content/panels/img/pocketmenuitem16.png
rename : browser/components/pocket/panels/img/pocketmenuitem16@2x.png => browser/extensions/pocket/content/panels/img/pocketmenuitem16@2x.png
rename : browser/components/pocket/panels/img/pocketsignup_button@1x.png => browser/extensions/pocket/content/panels/img/pocketsignup_button@1x.png
rename : browser/components/pocket/panels/img/pocketsignup_button@2x.png => browser/extensions/pocket/content/panels/img/pocketsignup_button@2x.png
rename : browser/components/pocket/panels/img/pocketsignup_devices@1x.png => browser/extensions/pocket/content/panels/img/pocketsignup_devices@1x.png
rename : browser/components/pocket/panels/img/pocketsignup_devices@2x.png => browser/extensions/pocket/content/panels/img/pocketsignup_devices@2x.png
rename : browser/components/pocket/panels/img/pocketsignup_hero@1x.png => browser/extensions/pocket/content/panels/img/pocketsignup_hero@1x.png
rename : browser/components/pocket/panels/img/pocketsignup_hero@2x.png => browser/extensions/pocket/content/panels/img/pocketsignup_hero@2x.png
rename : browser/components/pocket/panels/img/signup_firefoxlogo@1x.png => browser/extensions/pocket/content/panels/img/signup_firefoxlogo@1x.png
rename : browser/components/pocket/panels/img/signup_firefoxlogo@2x.png => browser/extensions/pocket/content/panels/img/signup_firefoxlogo@2x.png
rename : browser/components/pocket/panels/img/signup_help@1x.png => browser/extensions/pocket/content/panels/img/signup_help@1x.png
rename : browser/components/pocket/panels/img/signup_help@2x.png => browser/extensions/pocket/content/panels/img/signup_help@2x.png
rename : browser/components/pocket/panels/img/signup_or@1x.png => browser/extensions/pocket/content/panels/img/signup_or@1x.png
rename : browser/components/pocket/panels/img/signup_or@2x.png => browser/extensions/pocket/content/panels/img/signup_or@2x.png
rename : browser/components/pocket/panels/img/tag_close@1x.png => browser/extensions/pocket/content/panels/img/tag_close@1x.png
rename : browser/components/pocket/panels/img/tag_close@2x.png => browser/extensions/pocket/content/panels/img/tag_close@2x.png
rename : browser/components/pocket/panels/img/tag_closeactive@1x.png => browser/extensions/pocket/content/panels/img/tag_closeactive@1x.png
rename : browser/components/pocket/panels/img/tag_closeactive@2x.png => browser/extensions/pocket/content/panels/img/tag_closeactive@2x.png
rename : browser/components/pocket/panels/js/messages.js => browser/extensions/pocket/content/panels/js/messages.js
rename : browser/components/pocket/panels/js/saved.js => browser/extensions/pocket/content/panels/js/saved.js
rename : browser/components/pocket/panels/js/signup.js => browser/extensions/pocket/content/panels/js/signup.js
rename : browser/components/pocket/panels/js/tmpl.js => browser/extensions/pocket/content/panels/js/tmpl.js
rename : browser/components/pocket/panels/js/vendor/handlebars.runtime.js => browser/extensions/pocket/content/panels/js/vendor/handlebars.runtime.js
rename : browser/components/pocket/panels/js/vendor/jquery-2.1.1.min.js => browser/extensions/pocket/content/panels/js/vendor/jquery-2.1.1.min.js
rename : browser/components/pocket/panels/js/vendor/jquery.tokeninput.min.js => browser/extensions/pocket/content/panels/js/vendor/jquery.tokeninput.min.js
rename : browser/components/pocket/panels/license.txt => browser/extensions/pocket/content/panels/license.txt
rename : browser/components/pocket/panels/saved.html => browser/extensions/pocket/content/panels/saved.html
rename : browser/components/pocket/panels/signup.html => browser/extensions/pocket/content/panels/signup.html
rename : browser/components/pocket/panels/tmpl/saved_premiumextras.handlebars => browser/extensions/pocket/content/panels/tmpl/saved_premiumextras.handlebars
rename : browser/components/pocket/panels/tmpl/saved_premiumshell.handlebars => browser/extensions/pocket/content/panels/tmpl/saved_premiumshell.handlebars
rename : browser/components/pocket/panels/tmpl/saved_shell.handlebars => browser/extensions/pocket/content/panels/tmpl/saved_shell.handlebars
rename : browser/components/pocket/panels/tmpl/signup_shell.handlebars => browser/extensions/pocket/content/panels/tmpl/signup_shell.handlebars
rename : browser/components/pocket/panels/tmpl/signupstoryboard_shell.handlebars => browser/extensions/pocket/content/panels/tmpl/signupstoryboard_shell.handlebars
rename : browser/components/pocket/pktApi.js => browser/extensions/pocket/content/pktApi.jsm
rename : browser/locales/en-US/chrome/browser/browser-pocket.properties => browser/extensions/pocket/locales/en-US/pocket.properties
parent 6840233a
......@@ -1611,13 +1611,6 @@ pref("reader.parse-node-limit", 0);
// and because (normally) these errors are not persisted anywhere.
pref("reader.errors.includeURLs", true);
pref("browser.pocket.enabled", true);
pref("browser.pocket.api", "api.getpocket.com");
pref("browser.pocket.site", "getpocket.com");
pref("browser.pocket.oAuthConsumerKey", "40249-e88c401e1b1f2242d9e441c4");
pref("browser.pocket.useLocaleList", true);
pref("browser.pocket.enabledLocales", "cs de en-GB en-US en-ZA es-ES es-MX fr hu it ja ja-JP-mac ko nl pl pt-BR pt-PT ru zh-CN zh-TW");
pref("view_source.tab", true);
pref("dom.serviceWorkers.enabled", true);
......
......@@ -79,10 +79,6 @@
label="&saveLinkCmd.label;"
accesskey="&saveLinkCmd.accesskey;"
oncommand="gContextMenu.saveLink();"/>
<menuitem id="context-savelinktopocket"
label="&saveLinkToPocketCmd.label;"
accesskey="&saveLinkToPocketCmd.accesskey;"
oncommand="gContextMenu.saveLinkToPocket();"/>
<menu id="context-marklinkMenu" label="&social.marklinkMenu.label;"
accesskey="&social.marklinkMenu.accesskey;">
<menupopup/>
......@@ -270,10 +266,6 @@
label="&savePageCmd.label;"
accesskey="&savePageCmd.accesskey2;"
oncommand="gContextMenu.savePageAs();"/>
<menuitem id="context-pocket"
label="&saveToPocketCmd.label;"
accesskey="&saveToPocketCmd.accesskey;"
oncommand="gContextMenu.savePageToPocket();"/>
<menu id="context-markpageMenu" label="&social.markpageMenu.label;"
accesskey="&social.markpageMenu.accesskey;">
<menupopup/>
......
......@@ -413,7 +413,6 @@
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarkingUI.onMainMenuPopupShowing(event);
BookmarkingUI.updatePocketItemVisibility('menu_');
if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
tooltip="bhTooltip" popupsinherittooltip="true">
......@@ -422,12 +421,6 @@
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator id="organizeBookmarksSeparator"/>
<menuitem id="menu_pocket" label="&pocketMenuitem.label;"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
oncommand="openUILink(Pocket.listURL, event);"/>
<menuseparator id="menu_pocketSeparator"/>
<menuitem id="menu_bookmarkThisPage"
command="Browser:AddBookmarkAs"
observes="bookmarkThisPageBroadcaster"
......
......@@ -1554,12 +1554,6 @@ var BookmarkingUI = {
PlacesCommandHook.updateBookmarkAllTabsCommand();
},
updatePocketItemVisibility: function BUI_updatePocketItemVisibility(prefix) {
let hidden = !CustomizableUI.getPlacementOfWidget("pocket-button");
document.getElementById(prefix + "pocket").hidden = hidden;
document.getElementById(prefix + "pocketSeparator").hidden = hidden;
},
_showBookmarkedNotification: function BUI_showBookmarkedNotification() {
function getCenteringTransformForRects(rectToPosition, referenceRect) {
let topDiff = referenceRect.top - rectToPosition.top;
......@@ -1681,7 +1675,6 @@ var BookmarkingUI = {
onPanelMenuViewShowing: function BUI_onViewShowing(aEvent) {
this._updateBookmarkPageMenuItem();
this.updatePocketItemVisibility("panelMenu_");
// Update checked status of the toolbar toggle.
let viewToolbar = document.getElementById("panelMenu_viewBookmarksToolbar");
let personalToolbar = document.getElementById("PersonalToolbar");
......
......@@ -1348,9 +1348,8 @@ SocialMarks = {
// also means that populateToolbarPalette must be called prior to using this
// method, otherwise you get a big fat zero. For our use case with context
// menu's, this is ok.
let tbh = this._toolbarHelper;
return [p for (p of Social.providers) if (p.markURL &&
document.getElementById(tbh.idFromOrigin(p.origin)))];
document.getElementById(this._toolbarHelper.idFromOrigin(p.origin)))];
},
populateContextMenu: function() {
......
......@@ -53,37 +53,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "WindowsUIUtils",
"@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils");
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
"resource://gre/modules/LightweightThemeManager.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Pocket",
"resource:///modules/Pocket.jsm");
// Can't use XPCOMUtils for these because the scripts try to define the variables
// on window, and so the defineProperty inside defineLazyGetter fails.
Object.defineProperty(window, "pktApi", {
get: function() {
// Avoid this getter running again:
delete window.pktApi;
Services.scriptloader.loadSubScript("chrome://browser/content/pocket/pktApi.js", window);
return window.pktApi;
},
configurable: true,
enumerable: true
});
function pktUIGetter(prop) {
return {
get: function() {
// Avoid either of these getters running again:
delete window.pktUI;
delete window.pktUIMessaging;
Services.scriptloader.loadSubScript("chrome://browser/content/pocket/main.js", window);
return window[prop];
},
configurable: true,
enumerable: true
};
}
Object.defineProperty(window, "pktUI", pktUIGetter("pktUI"));
Object.defineProperty(window, "pktUIMessaging", pktUIGetter("pktUIMessaging"));
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
return Services.strings.createBundle('chrome://browser/locale/browser.properties');
......
......@@ -620,9 +620,9 @@
fullscreentoolbar="true" mode="icons" customizable="true"
iconsize="small"
#ifdef MOZ_DEV_EDITION
defaultset="urlbar-container,search-container,developer-button,bookmarks-menu-button,pocket-button,downloads-button,home-button,loop-button"
defaultset="urlbar-container,search-container,developer-button,bookmarks-menu-button,downloads-button,home-button,loop-button"
#else
defaultset="urlbar-container,search-container,bookmarks-menu-button,pocket-button,downloads-button,home-button,loop-button"
defaultset="urlbar-container,search-container,bookmarks-menu-button,downloads-button,home-button,loop-button"
#endif
customizationtarget="nav-bar-customization-target"
overflowable="true"
......@@ -798,7 +798,6 @@
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarkingUI.onPopupShowing(event);
BookmarkingUI.updatePocketItemVisibility('BMB_');
BookmarkingUI.attachPlacesView(event, this);"
tooltip="bhTooltip" popupsinherittooltip="true">
<menuitem id="BMB_viewBookmarksSidebar"
......@@ -815,11 +814,6 @@
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator/>
<menuitem id="BMB_pocket"
class="menuitem-iconic bookmark-item subviewbutton"
label="&pocketMenuitem.label;"
oncommand="openUILink(Pocket.listURL, event);"/>
<menuseparator id="BMB_pocketSeparator"/>
<menuitem id="BMB_subscribeToPageMenuitem"
#ifndef XP_MACOSX
class="menuitem-iconic subviewbutton"
......
......@@ -11,10 +11,6 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Pocket",
"resource:///modules/Pocket.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
"resource://gre/modules/LoginHelper.jsm");
......@@ -216,25 +212,6 @@ nsContextMenu.prototype = {
SimpleServiceDiscovery.services.length > 0 &&
CastingApps.getServicesForVideo(this.target).length > 0;
this.setItemAttr("context-castvideo", "disabled", !shouldShowCast);
this.initPocketItems();
},
initPocketItems: function CM_initPocketItems() {
var showSaveCurrentPageToPocket = !(this.onTextInput || this.onLink ||
this.isContentSelected || this.onImage ||
this.onCanvas || this.onVideo || this.onAudio);
let targetURI = (this.onSaveableLink || this.onPlainTextLink) ? this.linkURI : this.browser.currentURI;
let canPocket = CustomizableUI.getPlacementOfWidget("pocket-button") &&
window.pktApi && window.pktApi.isUserLoggedIn();
canPocket = canPocket && (targetURI.schemeIs("http") || targetURI.schemeIs("https") ||
(targetURI.schemeIs("about") && ReaderMode.getOriginalUrl(targetURI.spec)));
canPocket = canPocket && window.gBrowser && this.browser.getTabBrowser() == window.gBrowser;
this.showItem("context-pocket", canPocket && showSaveCurrentPageToPocket);
let showSaveLinkToPocket = canPocket && !showSaveCurrentPageToPocket &&
(this.onSaveableLink || this.onPlainTextLink);
this.showItem("context-savelinktopocket", showSaveLinkToPocket);
},
initViewItems: function CM_initViewItems() {
......@@ -1721,14 +1698,6 @@ nsContextMenu.prototype = {
saveBrowser(this.browser);
},
saveLinkToPocket: function CM_saveLinkToPocket() {
Pocket.savePage(this.browser, this.linkURL);
},
savePageToPocket: function CM_saveToPocket() {
Pocket.savePage(this.browser, this.browser.currentURI.spec, this.browser.contentTitle);
},
printFrame: function CM_printFrame() {
PrintUtils.printWindow(this.frameOuterWindowID, this.browser);
},
......
......@@ -12,7 +12,7 @@ var manifest2 = { // used for testing install
origin: "https://test1.example.com",
sidebarURL: "https://test1.example.com/browser/browser/base/content/test/social/social_sidebar_empty.html",
iconURL: "https://test1.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
var manifestUpgrade = { // used for testing install
name: "provider 3",
......@@ -20,7 +20,7 @@ var manifestUpgrade = { // used for testing install
sidebarURL: "https://test2.example.com/browser/browser/base/content/test/social/social_sidebar.html",
workerURL: "https://test2.example.com/browser/browser/base/content/test/social/social_worker.js",
iconURL: "https://test2.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
function test() {
......
......@@ -48,7 +48,6 @@ function test() {
CustomizableUI.removeWidgetFromArea("social-share-button", CustomizableUI.AREA_NAVBAR)
shareButton.remove();
}
ok(CustomizableUI.inDefaultState, "Should start in default state.");
next();
});
}
......
......@@ -13,7 +13,7 @@ var manifest = { // used for testing install
unmarkedIcon: "https://test1.example.com/browser/browser/base/content/test/social/checked.jpg",
iconURL: "https://test1.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
function test() {
......
......@@ -13,25 +13,20 @@ var manifest2 = { // used for testing install
unmarkedIcon: "https://test1.example.com/browser/browser/base/content/test/social/checked.jpg",
iconURL: "https://test1.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
var manifest3 = { // used for testing install
name: "provider test2",
origin: "https://test2.example.com",
sidebarURL: "https://test2.example.com/browser/browser/base/content/test/social/social_sidebar.html",
iconURL: "https://test2.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
function test() {
waitForExplicitFinish();
runSocialTests(tests, undefined, undefined, function () {
// Bug 1232207 - something breaks this on aurora on most platforms
// ok(CustomizableUI.inDefaultState, "Should be in the default state when we finish");
CustomizableUI.reset();
finish();
});
runSocialTests(tests, undefined, undefined, finish);
}
var tests = {
......
......@@ -8,18 +8,14 @@ function makeMarkProvider(origin) {
markedIcon: "https://" + origin + ".example.com/browser/browser/base/content/test/social/unchecked.jpg",
unmarkedIcon: "https://" + origin + ".example.com/browser/browser/base/content/test/social/checked.jpg",
iconURL: "https://" + origin + ".example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
}
}
function test() {
waitForExplicitFinish();
runSocialTests(tests, undefined, undefined, function () {
ok(CustomizableUI.inDefaultState, "Should be in the default state when we finish");
CustomizableUI.reset();
finish();
});
runSocialTests(tests, undefined, undefined, finish);
}
var tests = {
......
......@@ -17,14 +17,14 @@ var manifest2 = { // used for testing install
workerURL: "https://test1.example.com/browser/browser/base/content/test/social/social_worker.js",
statusURL: "https://test1.example.com/browser/browser/base/content/test/social/social_panel.html",
iconURL: "https://test1.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
var manifest3 = { // used for testing install
name: "provider test2",
origin: "https://test2.example.com",
sidebarURL: "https://test2.example.com/browser/browser/base/content/test/social/social_sidebar.html",
iconURL: "https://test2.example.com/browser/browser/base/content/test/general/moz.png",
version: 1
version: "1.0"
};
......@@ -45,7 +45,6 @@ function test() {
Services.prefs.clearUserPref("social.remote-install.enabled");
// just in case the tests failed, clear these here as well
Services.prefs.clearUserPref("social.whitelist");
ok(CustomizableUI.inDefaultState, "Should be in the default state when we finish");
CustomizableUI.reset();
finishcb();
});
......
......@@ -22,7 +22,7 @@ var data = {
"author": "Shane Caraveo, Mozilla",
// optional
"version": 1
"version": "1.0"
}
function activate(node) {
......
......@@ -20,7 +20,7 @@ var data = {
"author": "Shane Caraveo, Mozilla",
// optional
"version": 1
"version": "1.0"
}
function activate(node) {
......
......@@ -126,7 +126,7 @@ onconnect = function(e) {
case "social.manifest":
if (updatingManifest) {
updatingManifest = false;
event.data.data.version = 2;
event.data.data.version = "2.0";
apiPort.postMessage({topic: 'social.manifest-set', data: event.data.data});
} else if (testPort) {
testPort.postMessage({topic:"social.manifest", data: event.data.data});
......
......@@ -126,18 +126,6 @@ static RedirEntry kRedirMap[] = {
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
nsIAboutModule::MAKE_UNLINKABLE |
nsIAboutModule::HIDE_FROM_ABOUTABOUT },
{
"pocket-saved", "chrome://browser/content/pocket/panels/saved.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT |
nsIAboutModule::MAKE_UNLINKABLE },
{
"pocket-signup", "chrome://browser/content/pocket/panels/signup.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT |
nsIAboutModule::MAKE_UNLINKABLE },
};
static const int kRedirTotal = ArrayLength(kRedirMap);
......
......@@ -117,8 +117,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "looppanel", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "loopconversation", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "reader", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "pocket-saved", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "pocket-signup", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
#if defined(XP_WIN)
{ NS_IEHISTORYENUMERATOR_CONTRACTID, &kNS_WINIEHISTORYENUMERATOR_CID },
{ NS_EDGEREADINGLISTEXTRACTOR_CONTRACTID, &kNS_EDGEREADINGLISTEXTRACTOR_CID },
......
......@@ -56,7 +56,7 @@ const kSubviewEvents = [
* The current version. We can use this to auto-add new default widgets as necessary.
* (would be const but isn't because of testing purposes)
*/
var kVersion = 5;
var kVersion = 6;
/**
* Buttons removed from built-ins by version they were removed. kVersion must be
......@@ -64,7 +64,8 @@ var kVersion = 5;
* version the button is removed in as the value. e.g. "pocket-button": 5
*/
var ObsoleteBuiltinButtons = {
"loop-button": 5
"loop-button": 5,
"pocket-button": 6
};
/**
......@@ -222,15 +223,6 @@ var CustomizableUIInternal = {
"loop-button",
];
// Insert the Pocket button after the bookmarks button if it's present.
for (let widgetDefinition of CustomizableWidgets) {
if (widgetDefinition.id == "pocket-button") {
let idx = navbarPlacements.indexOf("bookmarks-menu-button") + 1;
navbarPlacements.splice(idx, 0, widgetDefinition.id);
break;
}
}
if (Services.prefs.getBoolPref(kPrefWebIDEInNavbar)) {
navbarPlacements.push("webide-button");
}
......@@ -3473,8 +3465,8 @@ this.CustomizableUI = {
*
* null // if the widget is not placed anywhere (ie in the palette)
*/
getPlacementOfWidget: function(aWidgetId) {
return CustomizableUIInternal.getPlacementOfWidget(aWidgetId, true);
getPlacementOfWidget: function(aWidgetId, aOnlyRegistered=true, aDeadAreas=false) {
return CustomizableUIInternal.getPlacementOfWidget(aWidgetId, aOnlyRegistered, aDeadAreas);
},
/**
* Check if a widget can be removed from the area it's in.
......
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