Back out 4f7f1840152b (bug 680113) for orange

This commit is contained in:
Phil Ringnalda 2011-09-09 22:18:19 -07:00
parent f90fd5539e
commit 4851b6a0f8
5 changed files with 29 additions and 45 deletions

View File

@ -1,10 +1,6 @@
#LOCALIZATION NOTE (source.profile) add-ons installed by the user, this may be
# translated as "You" or "User" depending on the locale
source.profile=You
#LOCALIZATION NOTE (source.bundled) add-ons shipped with the application, and thus
# treated as installed by the user. This may be
# translated as "You" or "User" depending on the locale
source.bundled=You (Bundled)
#LOCALIZATION NOTE (source.other) add-ons installed by other applications
# installed on the computer
source.other=Third Party

View File

@ -38,7 +38,6 @@
"use strict";
Components.utils.import("resource://gre/modules/AddonManager.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
const Cc = Components.classes;
const Ci = Components.interfaces;
@ -71,17 +70,10 @@ function showButtons(aCancel, aBack, aNext, aDone) {
document.getElementById("done").hidden = !aDone;
}
function isAddonDistroInstalled(aID) {
let branch = Services.prefs.getBranch("extensions.installedDistroAddon.");
if (!branch.prefHasUserValue(aID))
return false;
return branch.getBoolPref(aID);
}
function orderForScope(aScope) {
switch (aScope) {
case AddonManager.SCOPE_PROFILE:
return 2;
case AddonManager.SCOPE_APPLICATION:
return 1;
default:
@ -183,8 +175,7 @@ var gChecking = {
row.setAttribute("id", aEntry.addon.id);
row.setAttribute("class", "addon");
rows.appendChild(row);
row.setAddon(aEntry.addon, aEntry.install, aEntry.wasActive,
isAddonDistroInstalled(aEntry.addon.id));
row.setAddon(aEntry.addon, aEntry.install, aEntry.wasActive);
if (aEntry.install)
aEntry.install.addListener(gUpdate);

View File

@ -81,6 +81,7 @@
<field name="_wasActive"/>
<field name="_keep">document.getAnonymousElementByAttribute(this, "anonid", "keep");</field>
<field name="_update">document.getAnonymousElementByAttribute(this, "anonid", "update");</field>
<field name="_appStrings">document.getElementById("app-strings");</field>
<field name="_strings">document.getElementById("strings");</field>
<property name="action" readonly="true">
@ -109,7 +110,6 @@
<parameter name="aAddon"/>
<parameter name="aInstall"/>
<parameter name="aWasActive"/>
<parameter name="aDistroInstalled"/>
<body><![CDATA[
this._addon = aAddon;
this._install = aInstall;
@ -120,18 +120,14 @@
// User and application installed add-ons default to staying enabled,
// others default to disabled.
let scope = aAddon.scope;
if (aDistroInstalled)
scope = AddonManager.SCOPE_APPLICATION;
switch (scope) {
switch (aAddon.scope) {
case AddonManager.SCOPE_PROFILE:
this._keep.checked = !aAddon.userDisabled;
this.setAttribute("source", this._strings.getString("source.profile"));
break;
case AddonManager.SCOPE_APPLICATION:
this._keep.checked = !aAddon.userDisabled;
this.setAttribute("source", this._strings.getString("source.bundled"));
this.setAttribute("source", this._appStrings.getString("brandShortName"));
break;
default:
this._keep.checked = false;

View File

@ -52,6 +52,7 @@
style="&upgrade.style;" id="select-window">
<script type="application/javascript" src="chrome://mozapps/content/extensions/selectAddons.js"/>
<stringbundle id="app-strings" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="strings" src="chrome://mozapps/locale/extensions/selectAddons.properties"/>
<deck id="view-deck" flex="1" align="stretch" pack="stretch">

View File

@ -17,27 +17,27 @@ const SYSTEM = AddonManager.SCOPE_SYSTEM;
// of the application ran with this add-on.
var ADDONS = [
//userDisabled wasAppDisabled isAppDisabled isActive hasUpdate autoUpdate scope defaultKeep position keepString disableString
[false, true, false, false, false, true, PROFILE, true, 46, "enabled", ""], // 0
[false, true, false, false, true, true, PROFILE, true, 47, "enabled", ""], // 1
[false, true, false, false, true, false, PROFILE, true, 52, "unneededupdate", ""], // 2
[false, false, false, true, false, true, PROFILE, true, 53, "", "disabled"], // 3
[false, false, false, true, true, true, PROFILE, true, 54, "", "disabled"], // 4
[false, false, false, true, true, false, PROFILE, true, 55, "unneededupdate", "disabled"], // 5
[false, true, true, false, false, true, PROFILE, true, 56, "incompatible", ""], // 6
[false, true, true, false, true, true, PROFILE, true, 57, "autoupdate", ""], // 7
[false, true, true, false, true, false, PROFILE, true, 58, "neededupdate", ""], // 8
[false, false, true, true, false, true, PROFILE, true, 59, "incompatible", "disabled"], // 9
[false, true, true, true, true, true, PROFILE, true, 48, "autoupdate", "disabled"], // 10
[false, true, true, true, true, false, PROFILE, true, 49, "neededupdate", "disabled"], // 11
[true, false, false, false, false, true, PROFILE, false, 50, "enabled", ""], // 12
[true, false, false, false, true, true, PROFILE, false, 51, "enabled", ""], // 13
[true, false, false, false, true, false, PROFILE, false, 52, "unneededupdate", ""], // 14
[false, true, false, false, false, true, PROFILE, true, 72, "enabled", ""], // 0
[false, true, false, false, true, true, PROFILE, true, 73, "enabled", ""], // 1
[false, true, false, false, true, false, PROFILE, true, 82, "unneededupdate", ""], // 2
[false, false, false, true, false, true, PROFILE, true, 83, "", "disabled"], // 3
[false, false, false, true, true, true, PROFILE, true, 84, "", "disabled"], // 4
[false, false, false, true, true, false, PROFILE, true, 85, "unneededupdate", "disabled"], // 5
[false, true, true, false, false, true, PROFILE, true, 86, "incompatible", ""], // 6
[false, true, true, false, true, true, PROFILE, true, 87, "autoupdate", ""], // 7
[false, true, true, false, true, false, PROFILE, true, 88, "neededupdate", ""], // 8
[false, false, true, true, false, true, PROFILE, true, 89, "incompatible", "disabled"], // 9
[false, true, true, true, true, true, PROFILE, true, 74, "autoupdate", "disabled"], // 10
[false, true, true, true, true, false, PROFILE, true, 75, "neededupdate", "disabled"], // 11
[true, false, false, false, false, true, PROFILE, false, 76, "enabled", ""], // 12
[true, false, false, false, true, true, PROFILE, false, 77, "enabled", ""], // 13
[true, false, false, false, true, false, PROFILE, false, 78, "unneededupdate", ""], // 14
// userDisabled and isActive cannot be true on startup
[true, true, true, false, false, true, PROFILE, false, 38, "incompatible", ""], // 15
[true, true, true, false, true, true, PROFILE, false, 39, "autoupdate", ""], // 16
[true, true, true, false, true, false, PROFILE, false, 40, "neededupdate", ""], // 17
[true, true, true, false, false, true, PROFILE, false, 79, "incompatible", ""], // 15
[true, true, true, false, true, true, PROFILE, false, 80, "autoupdate", ""], // 16
[true, true, true, false, true, false, PROFILE, false, 81, "neededupdate", ""], // 17
// userDisabled and isActive cannot be true on startup
@ -50,10 +50,10 @@ var ADDONS = [
[true, true, false, false, true, false, SYSTEM, false, 5, "enabled", ""], // 23
[false, true, true, true, true, false, SYSTEM, false, 6, "incompatible", "disabled"], // 24
[true, true, true, false, true, false, SYSTEM, false, 7, "incompatible", ""], // 25
[false, false, false, true, true, false, APP, true, 42, "", "disabled"], // 26
[true, true, false, false, true, false, APP, false, 43, "enabled", ""], // 27
[false, true, true, true, true, false, APP, true, 44, "incompatible", "disabled"], // 28
[true, true, true, false, true, false, APP, false, 45, "incompatible", ""], // 29
[false, false, false, true, true, false, APP, true, 38, "", "disabled"], // 26
[true, true, false, false, true, false, APP, false, 39, "enabled", ""], // 27
[false, true, true, true, true, false, APP, true, 40, "incompatible", "disabled"], // 28
[true, true, true, false, true, false, APP, false, 41, "incompatible", ""], // 29
];
function waitForView(aView, aCallback) {
@ -227,7 +227,7 @@ add_test(function selection_test() {
pos++;
}
is(pos, 60, "Should have seen the right number of add-ons");
is(pos, 90, "Should have seen the right number of add-ons");
run_next_test();
});