Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: mobile/android/chrome/content/browser.js

Issue 4819695857303552: Issue 2561 - Installing extensions should not be allowed until official support lands (Closed)
Patch Set: Created May 22, 2015, 1:41 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mobile/android/base/AndroidManifest.xml.in ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #filter substitution 1 #filter substitution
2 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2- skip-preprocessor-directives: t; -*- 2 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2- skip-preprocessor-directives: t; -*-
3 /* This Source Code Form is subject to the terms of the Mozilla Public 3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 "use strict"; 6 "use strict";
7 7
8 let Cc = Components.classes; 8 let Cc = Components.classes;
9 let Ci = Components.interfaces; 9 let Ci = Components.interfaces;
10 let Cu = Components.utils; 10 let Cu = Components.utils;
(...skipping 6062 matching lines...) Expand 10 before | Expand all | Expand 10 after
6073 6073
6074 let host = null; 6074 let host = null;
6075 if (installInfo.originatingURI) { 6075 if (installInfo.originatingURI) {
6076 host = installInfo.originatingURI.host; 6076 host = installInfo.originatingURI.host;
6077 } 6077 }
6078 6078
6079 let brandShortName = Strings.brand.GetStringFromName("brandShortName"); 6079 let brandShortName = Strings.brand.GetStringFromName("brandShortName");
6080 let notificationName, buttons, message; 6080 let notificationName, buttons, message;
6081 let strings = Strings.browser; 6081 let strings = Strings.browser;
6082 let enabled = true; 6082 let enabled = true;
6083
6084 // We are forcing xpinstall.enabled to false here because of
6085 // https://issues.adblockplus.org/ticket/2561
6086 Services.prefs.setBoolPref("xpinstall.enabled", false);
6087
6083 try { 6088 try {
6084 enabled = Services.prefs.getBoolPref("xpinstall.enabled"); 6089 enabled = Services.prefs.getBoolPref("xpinstall.enabled");
6085 } 6090 }
6086 catch (e) {} 6091 catch (e) {}
6087 6092
6088 if (!enabled) { 6093 if (!enabled) {
6089 notificationName = "xpinstall-disabled"; 6094 notificationName = "xpinstall-disabled";
6090 if (Services.prefs.prefIsLocked("xpinstall.enabled")) { 6095 » // We force xpinstall.enabled to be a locked pref here because of
6096 » // https://issues.adblockplus.org/ticket/2561
6097 // if (Services.prefs.prefIsLocked("xpinstall.enabled")) {
6098 if (true) {
6091 message = strings.GetStringFromName("xpinstallDisabledMessageLocked" ); 6099 message = strings.GetStringFromName("xpinstallDisabledMessageLocked" );
6092 buttons = []; 6100 buttons = [];
6093 } else { 6101 } else {
6094 message = strings.formatStringFromName("xpinstallDisabledMessage2", [brandShortName, host], 2); 6102 message = strings.formatStringFromName("xpinstallDisabledMessage2", [brandShortName, host], 2);
6095 buttons = [{ 6103 buttons = [{
6096 label: strings.GetStringFromName("xpinstallDisabledButton"), 6104 label: strings.GetStringFromName("xpinstallDisabledButton"),
6097 callback: function editPrefs() { 6105 callback: function editPrefs() {
6098 Services.prefs.setBoolPref("xpinstall.enabled", true); 6106 Services.prefs.setBoolPref("xpinstall.enabled", true);
6099 return false; 6107 return false;
6100 } 6108 }
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
7942 disabled: elt.disabled, 7950 disabled: elt.disabled,
7943 menu: elt instanceof Ci.nsIDOMHTMLMenuElement 7951 menu: elt instanceof Ci.nsIDOMHTMLMenuElement
7944 }; 7952 };
7945 } 7953 }
7946 }, 7954 },
7947 }); 7955 });
7948 7956
7949 let {AdblockPlusApi} = Cu.import("chrome://adblockplus/content/Api.jsm"); 7957 let {AdblockPlusApi} = Cu.import("chrome://adblockplus/content/Api.jsm");
7950 AdblockPlusApi.initCommunication(); 7958 AdblockPlusApi.initCommunication();
7951 7959
OLDNEW
« no previous file with comments | « mobile/android/base/AndroidManifest.xml.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld