Bug 836415 - Kill PFS. r=bsmedberg

This commit is contained in:
Justin Dolske 2014-09-18 10:01:23 -07:00
Родитель 975f81ae39
Коммит c80af2ab0d
54 изменённых файлов: 3 добавлений и 2695 удалений

Просмотреть файл

@ -664,8 +664,6 @@ pref("plugins.update.notifyUser", false);
pref("plugins.click_to_play", true);
pref("plugins.hideMissingPluginsNotification", false);
pref("plugin.default.state", 1);
// Plugins bundled in XPIs are enabled by default.
@ -845,9 +843,6 @@ pref("plugin.state.personalplugin", 2);
pref("plugin.state.libplugins", 2);
#endif
// display door hanger if flash not installed
pref("plugins.notifyMissingFlash", true);
#ifdef XP_MACOSX
pref("browser.preferences.animateFadeIn", true);
#else

Просмотреть файл

@ -4,8 +4,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
var gPluginHandler = {
PREF_NOTIFY_MISSING_FLASH: "plugins.notifyMissingFlash",
PREF_HIDE_MISSING_PLUGINS_NOTIFICATION: "plugins.hideMissingPluginsNotification",
PREF_SESSION_PERSIST_MINUTES: "plugin.sessionPermissionNow.intervalInMinutes",
PREF_PERSISTENT_DAYS: "plugin.persistentPermissionAlways.intervalInDays",
MESSAGES: [
@ -93,94 +91,6 @@ var gPluginHandler = {
},
#endif
supportedPlugins: {
"mimetypes": {
"application/x-shockwave-flash": "flash",
"application/futuresplash": "flash",
"application/x-java-.*": "java",
"application/x-director": "shockwave",
"application/(sdp|x-(mpeg|rtsp|sdp))": "quicktime",
"audio/(3gpp(2)?|AMR|aiff|basic|mid(i)?|mp4|mpeg|vnd\.qcelp|wav|x-(aiff|m4(a|b|p)|midi|mpeg|wav))": "quicktime",
"image/(pict|png|tiff|x-(macpaint|pict|png|quicktime|sgi|targa|tiff))": "quicktime",
"video/(3gpp(2)?|flc|mp4|mpeg|quicktime|sd-video|x-mpeg)": "quicktime",
"application/x-unknown": "test",
},
"plugins": {
"flash": {
"displayName": "Flash",
"installWINNT": true,
"installDarwin": true,
"installLinux": true,
},
"java": {
"displayName": "Java",
"installWINNT": true,
"installDarwin": true,
"installLinux": true,
},
"shockwave": {
"displayName": "Shockwave",
"installWINNT": true,
"installDarwin": true,
},
"quicktime": {
"displayName": "QuickTime",
"installWINNT": true,
},
"test": {
"displayName": "Test plugin",
"installWINNT": true,
"installLinux": true,
"installDarwin": true,
}
}
},
nameForSupportedPlugin: function (aMimeType) {
for (let type in this.supportedPlugins.mimetypes) {
let re = new RegExp(type);
if (re.test(aMimeType)) {
return this.supportedPlugins.mimetypes[type];
}
}
return null;
},
canInstallThisMimeType: function (aMimeType) {
let os = Services.appinfo.OS;
let pluginName = this.nameForSupportedPlugin(aMimeType);
if (pluginName && "install" + os in this.supportedPlugins.plugins[pluginName]) {
return true;
}
return false;
},
newPluginInstalled : function(event) {
// browser elements are anonymous so we can't just use target.
var browser = event.originalTarget;
// clear the plugin list, now that at least one plugin has been installed
browser.missingPlugins = null;
var notificationBox = gBrowser.getNotificationBox(browser);
var notification = notificationBox.getNotificationWithValue("missing-plugins");
if (notification)
notificationBox.removeNotification(notification);
// reload the browser to make the new plugin show.
browser.reload();
},
// Callback for user clicking on a missing (unsupported) plugin.
installSinglePlugin: function (pluginInfo) {
var missingPlugins = new Map();
missingPlugins.set(pluginInfo.mimetype, pluginInfo);
openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: missingPlugins, browser: gBrowser.selectedBrowser});
},
// Callback for user clicking on a disabled plugin
managePlugins: function () {
BrowserOpenAddonsMgr("addons://list/plugin");
@ -212,66 +122,6 @@ var gPluginHandler = {
openHelpLink("plugin-crashed", false);
},
showInstallNotification: function (browser, pluginInfo) {
let hideMissingPluginsNotification =
Services.prefs.getBoolPref(this.PREF_HIDE_MISSING_PLUGINS_NOTIFICATION);
if (hideMissingPluginsNotification) {
return false;
}
if (!browser.missingPlugins)
browser.missingPlugins = new Map();
browser.missingPlugins.set(pluginInfo.mimetype, pluginInfo);
// only show notification for small subset of plugins
let mimetype = pluginInfo.mimetype.split(";")[0];
if (!this.canInstallThisMimeType(mimetype))
return false;
let pluginIdentifier = this.nameForSupportedPlugin(mimetype);
if (!pluginIdentifier)
return false;
let displayName = this.supportedPlugins.plugins[pluginIdentifier].displayName;
// don't show several notifications
let notification = PopupNotifications.getNotification("plugins-not-found", browser);
if (notification)
return true;
let messageString = gNavigatorBundle.getString("installPlugin.message");
let mainAction = {
label: gNavigatorBundle.getFormattedString("installPlugin.button.label",
[displayName]),
accessKey: gNavigatorBundle.getString("installPlugin.button.accesskey"),
callback: function () {
openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: browser.missingPlugins, browser: browser});
}
};
let secondaryActions = null;
let options = { dismissed: true };
let showForFlash = Services.prefs.getBoolPref(this.PREF_NOTIFY_MISSING_FLASH);
if (pluginIdentifier == "flash" && showForFlash) {
let prefNotifyMissingFlash = this.PREF_NOTIFY_MISSING_FLASH;
secondaryActions = [{
label: gNavigatorBundle.getString("installPlugin.ignoreButton.label"),
accessKey: gNavigatorBundle.getString("installPlugin.ignoreButton.accesskey"),
callback: function () {
Services.prefs.setBoolPref(prefNotifyMissingFlash, false);
}
}];
options.dismissed = false;
}
PopupNotifications.show(browser, "plugins-not-found",
messageString, "plugin-install-notification-icon",
mainAction, secondaryActions, options);
return true;
},
_clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
if (event == "showing") {
Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN")

Просмотреть файл

@ -774,8 +774,6 @@ var gBrowserInit = {
gBrowser.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver, false);
gBrowser.addEventListener("NewPluginInstalled", gPluginHandler.newPluginInstalled, true);
Services.obs.addObserver(gPluginHandler.pluginCrashed, "plugin-crashed", false);
window.addEventListener("AppCommand", HandleAppCommandEvent, true);

Просмотреть файл

@ -723,7 +723,6 @@
<image id="webapps-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="web-notifications-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="plugin-install-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="bad-content-blocked-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="bad-content-unblocked-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"/>

Просмотреть файл

@ -762,10 +762,6 @@
aLocation.spec != "about:blank"))
this.mBrowser.userTypedValue = null;
// Clear out the missing plugins list since it's related to the
// previous location.
this.mBrowser.missingPlugins = null;
if (this.mTabBrowser.isFindBarInitialized(this.mTab)) {
let findBar = this.mTabBrowser.getFindBar(this.mTab);

Просмотреть файл

@ -61,7 +61,6 @@ function test() {
registerCleanupFunction(function() {
clearAllPluginPermissions();
Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
Services.prefs.clearUserPref("plugins.hideMissingPluginsNotification");
});
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
@ -112,26 +111,16 @@ function runAfterPluginBindingAttached(func) {
// Tests a page with an unknown plugin in it.
function test1a() {
ok(PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 1a, Should have displayed the missing plugin notification");
ok(gTestBrowser.missingPlugins, "Test 1a, Should be a missing plugin list");
ok(gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 1a, Should know about application/x-unknown");
ok(!gTestBrowser.missingPlugins.has("application/x-test"), "Test 1a, Should not know about application/x-test");
var pluginNode = gTestBrowser.contentDocument.getElementById("unknown");
ok(pluginNode, "Test 1a, Found plugin in page");
var objLoadingContent = pluginNode.QueryInterface(Ci.nsIObjectLoadingContent);
is(objLoadingContent.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED, "Test 1a, plugin fallback type should be PLUGIN_UNSUPPORTED");
Services.prefs.setBoolPref("plugins.hideMissingPluginsNotification", true);
prepareTest(runAfterPluginBindingAttached(test1b), gTestRoot + "plugin_unknown.html");
}
function test1b() {
ok(!PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 1b, Should not have displayed the missing plugin notification");
ok(!gTestBrowser.missingPlugins, "Test 1b, Should not be a missing plugin list");
Services.prefs.clearUserPref("plugins.hideMissingPluginsNotification");
var plugin = getTestPlugin();
ok(plugin, "Test 1b, Should have a test plugin");
plugin.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
@ -140,9 +129,6 @@ function test1b() {
// Tests a page with a working plugin in it.
function test2() {
ok(!PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 2, Should not have displayed the missing plugin notification");
ok(!gTestBrowser.missingPlugins, "Test 2, Should not be a missing plugin list");
var plugin = getTestPlugin();
ok(plugin, "Should have a test plugin");
plugin.enabledState = Ci.nsIPluginTag.STATE_DISABLED;
@ -151,9 +137,6 @@ function test2() {
// Tests a page with a disabled plugin in it.
function test3() {
ok(!PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 3, Should not have displayed the missing plugin notification");
ok(!gTestBrowser.missingPlugins, "Test 3, Should not be a missing plugin list");
new TabOpenListener("about:addons", test4, prepareTest5);
var pluginNode = gTestBrowser.contentDocument.getElementById("test");
@ -185,7 +168,6 @@ function prepareTest5() {
// Tests a page with a blocked plugin in it.
function test5() {
info("test5");
ok(!PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 5, Should not have displayed the missing plugin notification");
let notification = PopupNotifications.getNotification("click-to-play-plugins");
ok(notification, "Test 5: There should be a plugin notification for blocked plugins");
ok(notification.dismissed, "Test 5: The plugin notification should be dismissed by default");
@ -194,7 +176,6 @@ function test5() {
is(notification.options.pluginData.size, 1, "Test 5: Only the blocked plugin should be present in the notification");
ok(PopupNotifications.panel.firstChild._buttonContainer.hidden, "Part 5: The blocked plugins notification should not have any buttons visible.");
ok(!gTestBrowser.missingPlugins, "Test 5, Should not be a missing plugin list");
var pluginNode = gTestBrowser.contentDocument.getElementById("test");
ok(pluginNode, "Test 5, Found plugin in page");
var objLoadingContent = pluginNode.QueryInterface(Ci.nsIObjectLoadingContent);
@ -205,21 +186,11 @@ function test5() {
// Tests a page with a blocked and unknown plugin in it.
function test6() {
ok(PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 6, Should have displayed the missing plugin notification");
ok(gTestBrowser.missingPlugins, "Test 6, Should be a missing plugin list");
ok(gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 6, Should know about application/x-unknown");
ok(!gTestBrowser.missingPlugins.has("application/x-test"), "Test 6, application/x-test should not be a missing plugin");
prepareTest(runAfterPluginBindingAttached(test7), gTestRoot + "plugin_both2.html");
}
// Tests a page with a blocked and unknown plugin in it (alternate order to above).
function test7() {
ok(PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 7, Should have displayed the missing plugin notification");
ok(gTestBrowser.missingPlugins, "Test 7, Should be a missing plugin list");
ok(gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 7, Should know about application/x-unknown");
ok(!gTestBrowser.missingPlugins.has("application/x-test"), "Test 7, application/x-test should not be a missing plugin");
var plugin = getTestPlugin();
plugin.enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
getTestPlugin("Second Test Plug-in").enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
@ -231,8 +202,6 @@ function test7() {
// Tests a page with a working plugin that is click-to-play
function test8() {
ok(!PopupNotifications.getNotification("plugins-not-found", gTestBrowser), "Test 8, Should not have displayed the missing plugin notification");
ok(!gTestBrowser.missingPlugins, "Test 8, Should not be a missing plugin list");
ok(PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser), "Test 8, Should have a click-to-play notification");
var pluginNode = gTestBrowser.contentDocument.getElementById("test");
@ -349,8 +318,6 @@ function test15() {
function test17() {
var clickToPlayNotification = PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser);
ok(clickToPlayNotification, "Test 17, Should have a click-to-play notification");
var missingNotification = PopupNotifications.getNotification("missing-plugins", gTestBrowser);
ok(!missingNotification, "Test 17, Should not have a missing plugin notification");
setAndUpdateBlocklist(gHttpTestRoot + "blockPluginVulnerableUpdatable.xml",
function() {

Просмотреть файл

@ -188,7 +188,6 @@ function prepareTest(nextTest, url, skip) {
// Tests a page with normal play preview registration (1/2)
function test1a() {
var notificationBox = gBrowser.getNotificationBox(gTestBrowser);
ok(!notificationBox.getNotificationWithValue("missing-plugins"), "Test 1a, Should not have displayed the missing plugin notification");
ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 1a, Should not have displayed the blocked plugin notification");
var pluginInfo = getTestPlugin();

Просмотреть файл

@ -90,7 +90,6 @@ function prepareTest(nextTest, url, skip) {
// Tests a page with normal play preview registration (1/2)
function test1a() {
var notificationBox = gBrowser.getNotificationBox(gTestBrowser);
ok(!notificationBox.getNotificationWithValue("missing-plugins"), "Test 1a, Should not have displayed the missing plugin notification");
ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 1a, Should not have displayed the blocked plugin notification");
var pluginInfo = getTestPlugin();

Просмотреть файл

@ -1480,11 +1480,7 @@ BrowserGlue.prototype = {
}
if (currentUIVersion < 13) {
try {
if (Services.prefs.getBoolPref("plugins.hide_infobar_for_missing_plugin"))
Services.prefs.setBoolPref("plugins.notifyMissingFlash", false);
}
catch (ex) {}
/* Obsolete */
}
if (currentUIVersion < 14) {

Просмотреть файл

@ -103,13 +103,6 @@ popupShowPopupPrefix=Show '%S'
badContentBlocked.blocked.message=%S is blocking content on this page.
badContentBlocked.notblocked.message=%S is not blocking any content on this page.
# missing plugin installer
installPlugin.message = Would you like to install the plugin needed to display the media on this page?
installPlugin.button.label=Install %S
installPlugin.button.accesskey=I
installPlugin.ignoreButton.label=Don't ask again
installPlugin.ignoreButton.accesskey=N
crashedpluginsMessage.title=The %S plugin has crashed.
crashedpluginsMessage.reloadButton.label=Reload page
crashedpluginsMessage.reloadButton.accesskey=R

Просмотреть файл

@ -333,20 +333,7 @@ PluginContent.prototype = {
break;
case "PluginNotFound": {
let installable = this.showInstallNotification(plugin, eventType);
let contentWindow = plugin.ownerDocument.defaultView;
// For non-object plugin tags, register a click handler to install the
// plugin. Object tags can, and often do, deal with that themselves,
// so don't stomp on the page developers toes.
if (installable && !(plugin instanceof contentWindow.HTMLObjectElement)) {
let installStatus = this.getPluginUI(plugin, "installStatus");
installStatus.setAttribute("installable", "true");
let iconStatus = this.getPluginUI(plugin, "icon");
iconStatus.setAttribute("installable", "true");
let installLink = this.getPluginUI(plugin, "installPluginLink");
this.addLinkClickCallback(installLink, "installSinglePlugin", plugin);
}
/* NOP */
break;
}
@ -471,13 +458,6 @@ PluginContent.prototype = {
objLoadingContent.cancelPlayPreview();
},
// Callback for user clicking on a missing (unsupported) plugin.
installSinglePlugin: function (plugin) {
this.global.sendAsyncMessage("PluginContent:InstallSinglePlugin", {
pluginInfo: this._getPluginInfo(plugin),
});
},
// Forward a link click callback to the chrome process.
forwardCallback: function (name) {
this.global.sendAsyncMessage("PluginContent:LinkClickCallback", { name: name });
@ -506,13 +486,6 @@ PluginContent.prototype = {
this.global.content.location.reload();
},
showInstallNotification: function (plugin) {
let [shown] = this.global.sendSyncMessage("PluginContent:ShowInstallNotification", {
pluginInfo: this._getPluginInfo(plugin),
});
return shown;
},
// Event listener for click-to-play plugins.
_handleClickToPlayEvent: function (plugin) {
let doc = plugin.ownerDocument;

Просмотреть файл

@ -1132,10 +1132,6 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
}
.popup-notification-icon[popupid="plugins-not-found"] {
list-style-image: url(chrome://browser/skin/pluginInstall-64.png);
}
.popup-notification-icon[popupid="web-notifications"] {
list-style-image: url(chrome://browser/skin/notification-64.png);
}
@ -1301,10 +1297,6 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
#plugin-install-notification-icon {
list-style-image: url(chrome://browser/skin/pluginInstall-16.png);
}
#notification-popup-box[hidden] {
/* Override display:none to make the pluginBlockedNotification animation work
when showing the notification repeatedly. */

Просмотреть файл

@ -54,8 +54,6 @@ browser.jar:
* skin/classic/browser/pageInfo.css
skin/classic/browser/pageInfo.png
skin/classic/browser/page-livemarks.png
skin/classic/browser/pluginInstall-16.png
skin/classic/browser/pluginInstall-64.png
skin/classic/browser/pointerLock-16.png
skin/classic/browser/pointerLock-64.png
skin/classic/browser/Privacy-16.png

Двоичные данные
browser/themes/linux/pluginInstall-16.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 236 B

Двоичные данные
browser/themes/linux/pluginInstall-64.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Просмотреть файл

@ -3640,15 +3640,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
}
}
#plugin-install-notification-icon {
list-style-image: url(chrome://browser/skin/pluginInstall-16.png);
}
@media (min-resolution: 2dppx) {
#plugin-install-notification-icon {
list-style-image: url(chrome://browser/skin/pluginInstall-16@2x.png);
}
}
#notification-popup-box[hidden] {
/* Override display:none to make the pluginBlockedNotification animation work
when showing the notification repeatedly. */
@ -3974,15 +3965,6 @@ menulist.translate-infobar-element > .menulist-dropmarker {
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
}
.popup-notification-icon[popupid="plugins-not-found"] {
list-style-image: url(chrome://browser/skin/pluginInstall-64.png);
}
@media (min-resolution: 2dppx) {
.popup-notification-icon[popupid="plugins-not-found"] {
list-style-image: url(chrome://browser/skin/pluginInstall-64\@2x.png);
}
}
.addon-progress-description {
width: 350px;
max-width: 350px;

Просмотреть файл

@ -82,10 +82,6 @@ browser.jar:
skin/classic/browser/page-livemarks.png
skin/classic/browser/page-livemarks@2x.png
skin/classic/browser/pageInfo.css
skin/classic/browser/pluginInstall-16.png
skin/classic/browser/pluginInstall-16@2x.png
skin/classic/browser/pluginInstall-64.png
skin/classic/browser/pluginInstall-64@2x.png
skin/classic/browser/pointerLock-16.png
skin/classic/browser/pointerLock-16@2x.png
skin/classic/browser/pointerLock-64.png

Двоичные данные
browser/themes/osx/pluginInstall-16.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 236 B

Двоичные данные
browser/themes/osx/pluginInstall-16@2x.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 426 B

Двоичные данные
browser/themes/osx/pluginInstall-64.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичные данные
browser/themes/osx/pluginInstall-64@2x.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 4.5 KiB

Просмотреть файл

@ -2142,10 +2142,6 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
}
.popup-notification-icon[popupid="plugins-not-found"] {
list-style-image: url(chrome://browser/skin/pluginInstall-64.png);
}
.popup-notification-icon[popupid="web-notifications"] {
list-style-image: url(chrome://browser/skin/notification-64.png);
}
@ -2313,10 +2309,6 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
-moz-image-region: rect(0, 48px, 16px, 32px);
}
#plugin-install-notification-icon {
list-style-image: url(chrome://browser/skin/pluginInstall-16.png);
}
#notification-popup-box[hidden] {
/* Override display:none to make the pluginBlockedNotification animation work
when showing the notification repeatedly. */

Просмотреть файл

@ -64,8 +64,6 @@ browser.jar:
skin/classic/browser/pageInfo.css
skin/classic/browser/pageInfo.png
skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png)
skin/classic/browser/pluginInstall-16.png
skin/classic/browser/pluginInstall-64.png
skin/classic/browser/pointerLock-16.png
skin/classic/browser/pointerLock-64.png
skin/classic/browser/Privacy-16.png
@ -487,8 +485,6 @@ browser.jar:
skin/classic/aero/browser/pageInfo.css
skin/classic/aero/browser/pageInfo.png (pageInfo-aero.png)
skin/classic/aero/browser/page-livemarks.png (feeds/feedIcon16-aero.png)
skin/classic/aero/browser/pluginInstall-16.png
skin/classic/aero/browser/pluginInstall-64.png
skin/classic/aero/browser/pointerLock-16.png
skin/classic/aero/browser/pointerLock-64.png
skin/classic/aero/browser/Privacy-16.png (Privacy-16-aero.png)

Двоичные данные
browser/themes/windows/pluginInstall-16.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 236 B

Двоичные данные
browser/themes/windows/pluginInstall-64.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Просмотреть файл

@ -54,7 +54,6 @@ relativesrcdir toolkit/locales:
locale/@AB_CD@/browser/overrides/update/updates.properties (%chrome/mozapps/update/updates.properties)
# plugins
locale/@AB_CD@/browser/overrides/plugins/plugins.dtd (%chrome/mozapps/plugins/plugins.dtd)
locale/@AB_CD@/browser/overrides/plugins/plugins.properties (%chrome/mozapps/plugins/plugins.properties)
# about:support
locale/@AB_CD@/browser/overrides/global/aboutSupport.dtd (%chrome/global/aboutSupport.dtd)
locale/@AB_CD@/browser/overrides/global/aboutSupport.properties (%chrome/global/aboutSupport.properties)
@ -79,7 +78,6 @@ relativesrcdir toolkit/locales:
% override chrome://global/locale/search/search.properties chrome://browser/locale/overrides/search/search.properties
% override chrome://mozapps/locale/update/updates.properties chrome://browser/locale/overrides/update/updates.properties
% override chrome://mozapps/locale/plugins/plugins.dtd chrome://browser/locale/overrides/plugins/plugins.dtd
% override chrome://mozapps/locale/plugins/plugins.properties chrome://browser/locale/overrides/plugins/plugins.properties
% override chrome://global/locale/aboutSupport.dtd chrome://browser/locale/overrides/global/aboutSupport.dtd
% override chrome://global/locale/aboutSupport.properties chrome://browser/locale/overrides/global/aboutSupport.properties
% override chrome://global/locale/crashes.dtd chrome://browser/locale/overrides/crashreporter/crashes.dtd

Просмотреть файл

@ -1,95 +0,0 @@
# 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/.
#--------------------------------------------------------------------
# Install Actions
#--------------------------------------------------------------------
InstallFile=Installing: %s
InstallSharedFile=Installing Shared File: %s
ReplaceFile=Replacing: %s
ReplaceSharedFile=Replacing Shared File: %s
SkipFile=Skipping: %s
SkipSharedFile=Skipping Shared File: %s
DeleteFile=Deleting file: %s
DeleteComponent=Deleting component: %s
Execute=Executing: %s
ExecuteWithArgs=Executing: %s with argument: %s
CopyFile=Copy File: %s to %s
ExecuteFile=Execute File: %s
ExecuteFileWithArgs=Execute File: %s with argument: %s
MoveFile=Move File: %s to %s
RenameFile=Rename File: %s to %s
CreateFolder=Create Folder: %s
RemoveFolder=Remove Folder: %s
RenameFolder=Rename Folder: %s to %s
WindowsShortcut=Windows Shortcut: %s
MacAlias=Mac Alias: %s
WindowsRegisterServer=Windows Register Server: %s
UnknownFileOpCommand=Unknown file operation command!
Patch=Patching: %s
Uninstall=Uninstalling: %s
RegSkin=Register Skin: %s
RegLocale=Register Locale: %s
RegContent=Register Content: %s
RegPackage=Register Package: %s
#--------------------------------------------------------------------
# Dialog Messages
#--------------------------------------------------------------------
ApplyNowSkin=Use this theme
ApplyNowLocale=Use this locale
ConfirmSkin=Install the theme "%1$S" from %2$S?
ConfirmLocale=Install the locale "%1$S" from %2$S?
OK=Install
progress.queued=Queued
progress.downloading=Downloading…
progress.downloaded=Downloaded
progress.installing=Installing…
Unsigned=Unsigned
#--------------------------------------------------------------------
# Miscellaneous
#--------------------------------------------------------------------
ERROR=ERROR
error0=Success
error999=Restart to complete
error-202=Access denied
error-203=Unexpected installation error\nReview the Error Console log for more details.
error-204=Install script not found
error-207=Not a valid install package
error-208=Invalid argument
error-210=User canceled
error-214=Required file does not exist
error-215=Read only
error-218=AppleSingle extraction error
error-219=Invalid path
error-225=EXTRACTION_FAILED
error-227=Canceled
error-228=Download error
error-229=Script error
error-230=Already exists
error-235=Out of space
error-239=Chrome registration failed
error-240=Unfinished install
error-244=Unsupported package
error-260=Signing could not be verified.
error-261=Invalid file hash (possible download corruption)
error-262=Unknown or invalid file hash type
error-299=Out of memory
# there are other error codes, either rare or obsolete,
# that are not worth translating at this time.
unknown.error=Unexpected error %S

Просмотреть файл

@ -1,27 +1,6 @@
<!-- 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/. -->
<!ENTITY pluginWizard.title "Plugin Finder Service">
<!ENTITY pluginWizard.firstPage.title "Welcome to the &pluginWizard.title;">
<!ENTITY pluginWizard.checkingForPlugins.description.label "&brandShortName; is now checking for available plugins…">
<!ENTITY pluginWizard.availablePluginsPage.title "Available Plugin Downloads">
<!ENTITY pluginWizard.availablePluginsPage.description.label "The following plugins are available:">
<!ENTITY pluginWizard.availablePluginsPage.continueMsg.label "Press Next to install these plugins.">
<!ENTITY pluginWizard.availablePluginsPage.installerUI "Some plugins may require additional information from you during installation.">
<!ENTITY pluginWizard.licensePage.title "Plugin Licenses">
<!ENTITY pluginWizard.licensePage.accept.label "I agree.">
<!ENTITY pluginWizard.licensePage.deny.label "I do not agree (plugin will not be installed).">
<!ENTITY pluginWizard.installPluginsPage.title "Installing Plugins">
<!ENTITY pluginWizard.installPluginsPage.description.label "&brandShortName; is installing plugins…">
<!ENTITY pluginWizard.finalPage.description.label "&brandShortName; finished installing the missing plugins:">
<!ENTITY pluginWizard.finalPage.moreInfo.label "Find out more about Plugins or manually find missing plugins.">
<!ENTITY pluginWizard.finalPage.restart.label "&brandShortName; needs to be restarted for the plugin(s) to work.">
<!-- LOCALIZATION NOTE (unsupportedPlatform.pre): Mobile only. Flash (the only plugin available on mobile)
is not supported on some devices. Include a trailing space as needed. -->
@ -40,7 +19,6 @@
<!ENTITY disabledPlugin "This plugin is disabled.">
<!ENTITY blockedPlugin.label "This plugin has been blocked for your protection.">
<!ENTITY hidePluginBtn.label "Hide plugin">
<!ENTITY installPlugin "Install plugin…">
<!ENTITY managePlugins "Manage plugins…">
<!-- LOCALIZATION NOTE (reloadPlugin.pre): include a trailing space as needed -->

Просмотреть файл

@ -1,30 +0,0 @@
# 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/.
pluginLicenseAgreement.label=To install %S, you need to agree to the following:
pluginInstallation.download.start=Downloading %S…
pluginInstallation.download.finish=Finished downloading %S.
pluginInstallation.install.start=Installing %S…
pluginInstallation.install.finish=Successfully installed %S.
pluginInstallation.install.error=Failed to install %S (%S).
pluginInstallation.complete=Finished installing plugins.
pluginInstallationSummary.success=Installed
pluginInstallationSummary.failed=Failed
pluginInstallationSummary.licenseNotAccepted=License not accepted
pluginInstallationSummary.notAvailable=Not Available
pluginInstallationSummary.manualInstall.label=Manual Install
pluginInstallationSummary.manualInstall.tooltip=Manually install the plugin.
pluginInstallation.noPluginsFound=No suitable plugins were found.
pluginInstallation.noPluginsInstalled=No plugins were installed.
pluginInstallation.unknownPlugin=Unknown Plugin (%S)
pluginInstallation.restart.label=Restart %S
pluginInstallation.restart.accesskey=R
pluginInstallation.close.label=Close
pluginInstallation.close.accesskey=C

Просмотреть файл

@ -72,7 +72,6 @@
locale/@AB_CD@/global/webapps.properties (%chrome/global/webapps.properties)
locale/@AB_CD@/global/wizard.dtd (%chrome/global/wizard.dtd)
locale/@AB_CD@/global/wizard.properties (%chrome/global/wizard.properties)
locale/@AB_CD@/global/xpinstall/xpinstall.properties (%chrome/global/xpinstall/xpinstall.properties)
locale/@AB_CD@/global/crashes.dtd (%crashreporter/crashes.dtd)
locale/@AB_CD@/global/crashes.properties (%crashreporter/crashes.properties)
% locale global-region @AB_CD@ %locale/@AB_CD@/global-region/
@ -103,7 +102,6 @@
locale/@AB_CD@/mozapps/handling/handling.dtd (%chrome/mozapps/handling/handling.dtd)
locale/@AB_CD@/mozapps/handling/handling.properties (%chrome/mozapps/handling/handling.properties)
locale/@AB_CD@/mozapps/plugins/plugins.dtd (%chrome/mozapps/plugins/plugins.dtd)
locale/@AB_CD@/mozapps/plugins/plugins.properties (%chrome/mozapps/plugins/plugins.properties)
locale/@AB_CD@/mozapps/preferences/changemp.dtd (%chrome/mozapps/preferences/changemp.dtd)
locale/@AB_CD@/mozapps/preferences/removemp.dtd (%chrome/mozapps/preferences/removemp.dtd)
locale/@AB_CD@/mozapps/preferences/preferences.properties (%chrome/mozapps/preferences/preferences.properties)

Просмотреть файл

@ -1,150 +0,0 @@
/* 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/. */
const PFS_NS = "http://www.mozilla.org/2004/pfs-rdf#";
function nsRDFItemUpdater(aClientOS, aChromeLocale) {
this._rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"]
.getService(Components.interfaces.nsIRDFService);
this._os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
var app = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
this.appID = app.ID;
this.buildID = app.platformBuildID;
this.appRelease = app.version;
this.clientOS = aClientOS;
this.chromeLocale = aChromeLocale;
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
this.dsURI = prefBranch.getCharPref("pfs.datasource.url");
}
nsRDFItemUpdater.prototype = {
checkForPlugin: function (aPluginRequestItem) {
var dsURI = this.dsURI;
// escape the mimetype as mimetypes can contain '+', which will break pfs.
dsURI = dsURI.replace(/%PLUGIN_MIMETYPE%/g, encodeURIComponent(aPluginRequestItem.mimetype));
dsURI = dsURI.replace(/%APP_ID%/g, this.appID);
dsURI = dsURI.replace(/%APP_VERSION%/g, this.buildID);
dsURI = dsURI.replace(/%APP_RELEASE%/g, this.appRelease);
dsURI = dsURI.replace(/%CLIENT_OS%/g, this.clientOS);
dsURI = dsURI.replace(/%CHROME_LOCALE%/g, this.chromeLocale);
var ds = this._rdfService.GetDataSource(dsURI);
var rds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource)
if (rds.loaded)
this.onDatasourceLoaded(ds, aPluginRequestItem);
else {
var sink = ds.QueryInterface(Components.interfaces.nsIRDFXMLSink);
sink.addXMLSinkObserver(new nsPluginXMLRDFDSObserver(this, aPluginRequestItem));
}
},
onDatasourceLoaded: function pfs_onDatasourceLoaded (aDatasource, aPluginRequestItem) {
var container = Components.classes["@mozilla.org/rdf/container;1"]
.createInstance(Components.interfaces.nsIRDFContainer);
var resultRes = this._rdfService.GetResource("urn:mozilla:plugin-results:" + aPluginRequestItem.mimetype);
var pluginList = aDatasource.GetTarget(resultRes, this._rdfService.GetResource(PFS_NS+"plugins"), true);
var pluginInfo = null;
try {
container.Init(aDatasource, pluginList);
var children = container.GetElements();
var target;
// get the first item
var child = children.getNext();
if (child instanceof Components.interfaces.nsIRDFResource) {
var name = this._rdfService.GetResource("http://www.mozilla.org/2004/pfs-rdf#updates");
target = aDatasource.GetTarget(child, name, true);
}
try {
container.Init(aDatasource, target);
target = null;
children = container.GetElements();
var child = children.getNext();
if (child instanceof Components.interfaces.nsIRDFResource) {
target = child;
}
var rdfs = this._rdfService;
function getPFSValueFromRDF(aValue) {
var rv = null;
var myTarget = aDatasource.GetTarget(target, rdfs.GetResource(PFS_NS + aValue), true);
if (myTarget)
rv = myTarget.QueryInterface(Components.interfaces.nsIRDFLiteral).Value;
return rv;
}
pluginInfo = {
name: getPFSValueFromRDF("name"),
pid: getPFSValueFromRDF("guid"),
version: getPFSValueFromRDF("version"),
IconUrl: getPFSValueFromRDF("IconUrl"),
InstallerLocation: getPFSValueFromRDF("InstallerLocation"),
InstallerHash: getPFSValueFromRDF("InstallerHash"),
XPILocation: getPFSValueFromRDF("XPILocation"),
XPIHash: getPFSValueFromRDF("XPIHash"),
InstallerShowsUI: getPFSValueFromRDF("InstallerShowsUI"),
manualInstallationURL: getPFSValueFromRDF("manualInstallationURL"),
requestedMimetype: getPFSValueFromRDF("requestedMimetype"),
licenseURL: getPFSValueFromRDF("licenseURL"),
needsRestart: getPFSValueFromRDF("needsRestart")
};
}
catch (ex) {
Components.utils.reportError(ex);
}
}
catch (ex) {
Components.utils.reportError(ex);
}
gPluginInstaller.pluginInfoReceived(aPluginRequestItem, pluginInfo);
},
onDatasourceError: function pfs_onDatasourceError (aPluginRequestItem, aError) {
this._os.notifyObservers(aPluginRequestItem, "error", aError);
Components.utils.reportError(aError);
gPluginInstaller.pluginInfoReceived(aPluginRequestItem, null);
}
};
function nsPluginXMLRDFDSObserver(aUpdater, aPluginRequestItem) {
this._updater = aUpdater;
this._item = aPluginRequestItem;
}
nsPluginXMLRDFDSObserver.prototype =
{
_updater : null,
_item : null,
// nsIRDFXMLSinkObserver
onBeginLoad: function(aSink) {},
onInterrupt: function(aSink) {},
onResume: function(aSink) {},
onEndLoad: function(aSink) {
aSink.removeXMLSinkObserver(this);
var ds = aSink.QueryInterface(Components.interfaces.nsIRDFDataSource);
this._updater.onDatasourceLoaded(ds, this._item);
},
onError: function(aSink, aStatus, aErrorMsg) {
aSink.removeXMLSinkObserver(this);
this._updater.onDatasourceError(this._item, aStatus.toString());
}
};

Просмотреть файл

@ -1,299 +0,0 @@
/* 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/. */
Components.utils.import("resource://gre/modules/AddonManager.jsm");
const DOWNLOAD_STARTED = 0;
const DOWNLOAD_FINISHED = 1;
const INSTALL_STARTED = 2;
const INSTALL_FINISHED = 3;
const INSTALLS_COMPLETE = 4;
function getLocalizedError(key)
{
return document.getElementById("xpinstallStrings").getString(key);
}
function binaryToHex(input)
{
return [('0' + input.charCodeAt(i).toString(16)).slice(-2)
for (i in input)].join('');
}
function verifyHash(aFile, aHash)
{
try {
var [, method, hash] = /^([A-Za-z0-9]+):(.*)$/.exec(aHash);
var fis = Components.classes['@mozilla.org/network/file-input-stream;1'].
createInstance(Components.interfaces.nsIFileInputStream);
fis.init(aFile, -1, -1, 0);
var hasher = Components.classes['@mozilla.org/security/hash;1'].
createInstance(Components.interfaces.nsICryptoHash);
hasher.initWithString(method);
hasher.updateFromStream(fis, -1);
dlhash = binaryToHex(hasher.finish(false));
return dlhash == hash;
}
catch (e) {
Components.utils.reportError(e);
return false;
}
}
function InstallerObserver(aPlugin)
{
this._plugin = aPlugin;
this._init();
}
InstallerObserver.prototype = {
_init: function()
{
try {
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI(this._plugin.InstallerLocation, null, null);
uri.QueryInterface(Components.interfaces.nsIURL);
// Use a local filename appropriate for the OS
var leafName = uri.fileName;
var os = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULRuntime)
.OS;
if (os == "WINNT" && leafName.indexOf(".") < 0)
leafName += ".exe";
var dirs = Components.classes["@mozilla.org/file/directory_service;1"].
getService(Components.interfaces.nsIProperties);
var resultFile = dirs.get("TmpD", Components.interfaces.nsIFile);
resultFile.append(leafName);
resultFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
0770);
var channel = ios.newChannelFromURI(uri);
this._downloader =
Components.classes["@mozilla.org/network/downloader;1"].
createInstance(Components.interfaces.nsIDownloader);
this._downloader.init(this, resultFile);
channel.notificationCallbacks = this;
this._fireNotification(DOWNLOAD_STARTED, null);
channel.asyncOpen(this._downloader, null);
}
catch (e) {
Components.utils.reportError(e);
this._fireNotification(INSTALL_FINISHED, getLocalizedError("error-228"));
if (resultFile && resultFile.exists())
resultfile.remove(false);
}
},
/**
* Inform the gPluginInstaller about what's going on.
*/
_fireNotification: function(aStatus, aErrorMsg)
{
gPluginInstaller.pluginInstallationProgress(this._plugin.pid,
aStatus, aErrorMsg);
if (aStatus == INSTALL_FINISHED) {
--PluginInstallService._installersPending;
PluginInstallService._fireFinishedNotification();
}
},
QueryInterface: function(iid)
{
if (iid.equals(Components.interfaces.nsISupports) ||
iid.equals(Components.interfaces.nsIInterfaceRequestor) ||
iid.equals(Components.interfaces.nsIDownloadObserver) ||
iid.equals(Components.interfaces.nsIProgressEventSink))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
getInterface: function(iid)
{
if (iid.equals(Components.interfaces.nsIProgressEventSink))
return this;
return null;
},
onDownloadComplete: function(downloader, request, ctxt, status, result)
{
if (!Components.isSuccessCode(status)) {
// xpinstall error 228 is "Download Error"
this._fireNotification(INSTALL_FINISHED, getLocalizedError("error-228"));
result.remove(false);
return;
}
this._fireNotification(DOWNLOAD_FINISHED);
if (this._plugin.InstallerHash &&
!verifyHash(result, this._plugin.InstallerHash)) {
// xpinstall error 261 is "Invalid file hash..."
this._fireNotification(INSTALL_FINISHED, getLocalizedError("error-261"));
result.remove(false);
return;
}
this._fireNotification(INSTALL_STARTED);
result.QueryInterface(Components.interfaces.nsILocalFile);
try {
// Make sure the file is executable
result.permissions = 0770;
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(result);
var self = this;
process.runAsync([], 0, {
observe: function(subject, topic, data) {
if (topic != "process-finished") {
Components.utils.reportError("Failed to launch installer");
self._fireNotification(INSTALL_FINISHED,
getLocalizedError("error-207"));
}
else if (process.exitValue != 0) {
Components.utils.reportError("Installer returned exit code " + process.exitValue);
self._fireNotification(INSTALL_FINISHED,
getLocalizedError("error-203"));
}
else {
self._fireNotification(INSTALL_FINISHED, null);
}
result.remove(false);
}
});
}
catch (e) {
Components.utils.reportError(e);
this._fireNotification(INSTALL_FINISHED, getLocalizedError("error-207"));
result.remove(false);
}
},
onProgress: function(aRequest, aContext, aProgress, aProgressMax)
{
gPluginInstaller.pluginInstallationProgressMeter(this._plugin.pid,
aProgress,
aProgressMax);
},
onStatus: function(aRequest, aContext, aStatus, aStatusArg)
{
/* pass */
}
};
var PluginInstallService = {
/**
* Start installation of installers and XPI plugins.
* @param aInstallerPlugins An array of objects which should have the
* properties "pid", "InstallerLocation",
* and "InstallerHash"
* @param aXPIPlugins An array of objects which should have the
* properties "pid", "XPILocation",
* and "XPIHash"
*/
startPluginInstallation: function (aInstallerPlugins,
aXPIPlugins)
{
this._xpiPlugins = aXPIPlugins;
this._xpisPending = aXPIPlugins.length;
aXPIPlugins.forEach(function(plugin) {
AddonManager.getInstallForURL(plugin.XPILocation, function(install) {
install.addListener(PluginInstallService);
install.install();
}, "application/x-xpinstall", plugin.XPIHash);
});
// InstallerObserver may finish immediately so we must initialise the
// installers after setting the number of installers and xpis pending
this._installersPending = aInstallerPlugins.length;
this._installerPlugins = [new InstallerObserver(plugin)
for each (plugin in aInstallerPlugins)];
},
_fireFinishedNotification: function()
{
if (this._installersPending == 0 && this._xpisPending == 0)
gPluginInstaller.pluginInstallationProgress(null, INSTALLS_COMPLETE, null);
},
getPidForInstall: function(install) {
for (let i = 0; i < this._xpiPlugins.length; i++) {
if (install.sourceURI.spec == this._xpiPlugins[i].XPILocation)
return this._xpiPlugins[i].pid;
}
return -1;
},
// InstallListener interface
onDownloadStarted: function(install) {
var pid = this.getPidForInstall(install);
gPluginInstaller.pluginInstallationProgress(pid, DOWNLOAD_STARTED, null);
},
onDownloadProgress: function(install) {
var pid = this.getPidForInstall(install);
gPluginInstaller.pluginInstallationProgressMeter(pid, install.progress,
install.maxProgress);
},
onDownloadEnded: function(install) {
var pid = this.getPidForInstall(install);
gPluginInstaller.pluginInstallationProgress(pid, DOWNLOAD_FINISHED, null);
},
onDownloadFailed: function(install) {
var pid = this.getPidForInstall(install);
switch (install.error) {
case AddonManager.ERROR_NETWORK_FAILURE:
var errorMsg = getLocalizedError("error-228");
break;
case AddonManager.ERROR_INCORRECT_HASH:
var errorMsg = getLocalizedError("error-261");
break;
case AddonManager.ERROR_CORRUPT_FILE:
var errorMsg = getLocalizedError("error-207");
break;
}
gPluginInstaller.pluginInstallationProgress(pid, INSTALL_FINISHED, errorMsg);
this._xpisPending--;
this._fireFinishedNotification();
},
onInstallStarted: function(install) {
var pid = this.getPidForInstall(install);
gPluginInstaller.pluginInstallationProgress(pid, INSTALL_STARTED, null);
},
onInstallEnded: function(install, addon) {
var pid = this.getPidForInstall(install);
gPluginInstaller.pluginInstallationProgress(pid, INSTALL_FINISHED, null);
this._xpisPending--;
this._fireFinishedNotification();
},
onInstallFailed: function(install) {
var pid = this.getPidForInstall(install);
gPluginInstaller.pluginInstallationProgress(pid, INSTALL_FINISHED,
getLocalizedError("error-203"));
this._xpisPending--;
this._fireFinishedNotification();
}
}

Просмотреть файл

@ -1,9 +0,0 @@
/* 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/. */
.wizard-header-description {
display: none;
}

Просмотреть файл

@ -1,659 +0,0 @@
/* 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/. */
function nsPluginInstallerWizard(){
// create the request array
this.mPluginRequests = new Map();
// create the plugin info array.
// a hash indexed by plugin id so we don't install
// the same plugin more than once.
this.mPluginInfoArray = new Object();
this.mPluginInfoArrayLength = 0;
// holds plugins we couldn't find
this.mPluginNotFoundArray = new Object();
this.mPluginNotFoundArrayLength = 0;
// array holding pids of plugins that require a license
this.mPluginLicenseArray = new Array();
// how many plugins are to be installed
this.pluginsToInstallNum = 0;
this.mBrowser = null;
this.mSuccessfullPluginInstallation = 0;
this.mNeedsRestart = false;
// arguments[0] is an object that contains two items:
// a mimetype->pluginInfo map of missing plugins,
// a reference to the browser that needs them,
// so we can notify which browser can be reloaded.
if ("arguments" in window) {
for (let [mimetype, pluginInfo] of window.arguments[0].plugins){
this.mPluginRequests.set(mimetype, new nsPluginRequest(pluginInfo));
}
this.mBrowser = window.arguments[0].browser;
}
this.WSPluginCounter = 0;
this.licenseAcceptCounter = 0;
this.prefBranch = null;
}
nsPluginInstallerWizard.prototype.getPluginData = function (){
// for each mPluginRequests item, call the datasource
this.WSPluginCounter = 0;
// initiate the datasource call
var rdfUpdater = new nsRDFItemUpdater(this.getOS(), this.getChromeLocale());
for (let [mimetype, pluginRequest] of this.mPluginRequests) {
rdfUpdater.checkForPlugin(pluginRequest);
}
}
// aPluginInfo is null if the datasource call failed, and pid is -1 if
// no matching plugin was found.
nsPluginInstallerWizard.prototype.pluginInfoReceived = function (aPluginRequestItem, aPluginInfo){
this.WSPluginCounter++;
if (aPluginInfo && (aPluginInfo.pid != -1) ) {
// hash by id
this.mPluginInfoArray[aPluginInfo.pid] = new PluginInfo(aPluginInfo);
this.mPluginInfoArrayLength++;
} else {
this.mPluginNotFoundArray[aPluginRequestItem.mimetype] = aPluginRequestItem;
this.mPluginNotFoundArrayLength++;
}
var progressMeter = document.getElementById("ws_request_progress");
if (progressMeter.getAttribute("mode") == "undetermined")
progressMeter.setAttribute("mode", "determined");
progressMeter.setAttribute("value",
((this.WSPluginCounter / this.mPluginRequests.size) * 100) + "%");
if (this.WSPluginCounter == this.mPluginRequests.size) {
// check if no plugins were found
if (this.mPluginInfoArrayLength == 0) {
this.advancePage("lastpage");
} else {
this.advancePage(null);
}
} else {
// process more.
}
}
nsPluginInstallerWizard.prototype.showPluginList = function (){
var myPluginList = document.getElementById("pluginList");
var hasPluginWithInstallerUI = false;
// clear children
for (var run = myPluginList.childNodes.length; run > 0; run--)
myPluginList.removeChild(myPluginList.childNodes.item(run));
this.pluginsToInstallNum = 0;
for (var pluginInfoItem in this.mPluginInfoArray){
// [plugin image] [Plugin_Name Plugin_Version]
var pluginInfo = this.mPluginInfoArray[pluginInfoItem];
// create the checkbox
var myCheckbox = document.createElement("checkbox");
myCheckbox.setAttribute("checked", "true");
myCheckbox.setAttribute("oncommand", "gPluginInstaller.toggleInstallPlugin('" + pluginInfo.pid + "', this)");
// XXXlocalize (nit)
myCheckbox.setAttribute("label", pluginInfo.name + " " + (pluginInfo.version ? pluginInfo.version : ""));
myCheckbox.setAttribute("src", pluginInfo.IconUrl);
myPluginList.appendChild(myCheckbox);
if (pluginInfo.InstallerShowsUI == "true")
hasPluginWithInstallerUI = true;
// keep a running count of plugins the user wants to install
this.pluginsToInstallNum++;
}
if (hasPluginWithInstallerUI)
document.getElementById("installerUI").hidden = false;
this.canAdvance(true);
this.canRewind(false);
}
nsPluginInstallerWizard.prototype.toggleInstallPlugin = function (aPid, aCheckbox) {
this.mPluginInfoArray[aPid].toBeInstalled = aCheckbox.checked;
// if no plugins are checked, don't allow to advance
this.pluginsToInstallNum = 0;
for (var pluginInfoItem in this.mPluginInfoArray){
if (this.mPluginInfoArray[pluginInfoItem].toBeInstalled)
this.pluginsToInstallNum++;
}
if (this.pluginsToInstallNum > 0)
this.canAdvance(true);
else
this.canAdvance(false);
}
nsPluginInstallerWizard.prototype.canAdvance = function (aBool){
document.getElementById("plugin-installer-wizard").canAdvance = aBool;
}
nsPluginInstallerWizard.prototype.canRewind = function (aBool){
document.getElementById("plugin-installer-wizard").canRewind = aBool;
}
nsPluginInstallerWizard.prototype.canCancel = function (aBool){
document.documentElement.getButton("cancel").disabled = !aBool;
}
nsPluginInstallerWizard.prototype.showLicenses = function (){
this.canAdvance(false);
this.canRewind(false);
// only add if a license is provided and the plugin was selected to
// be installed
for (var pluginInfoItem in this.mPluginInfoArray){
var myPluginInfoItem = this.mPluginInfoArray[pluginInfoItem];
if (myPluginInfoItem.toBeInstalled && myPluginInfoItem.licenseURL && (myPluginInfoItem.licenseURL != ""))
this.mPluginLicenseArray.push(myPluginInfoItem.pid);
}
if (this.mPluginLicenseArray.length == 0) {
// no plugins require licenses
this.advancePage(null);
} else {
this.licenseAcceptCounter = 0;
// add a nsIWebProgress listener to the license iframe.
var docShell = document.getElementById("licenseIFrame").docShell;
var iiReq = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var webProgress = iiReq.getInterface(Components.interfaces.nsIWebProgress);
webProgress.addProgressListener(gPluginInstaller.progressListener,
Components.interfaces.nsIWebProgress.NOTIFY_ALL);
this.showLicense();
}
}
nsPluginInstallerWizard.prototype.enableNext = function (){
// if only one plugin exists, don't enable the next button until
// the license is accepted
if (gPluginInstaller.pluginsToInstallNum > 1)
gPluginInstaller.canAdvance(true);
document.getElementById("licenseRadioGroup1").disabled = false;
document.getElementById("licenseRadioGroup2").disabled = false;
}
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
nsPluginInstallerWizard.prototype.progressListener = {
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
{
if ((aStateFlags & nsIWebProgressListener.STATE_STOP) &&
(aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK)) {
// iframe loaded
gPluginInstaller.enableNext();
}
},
onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress,
aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{},
onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
{},
QueryInterface : function(aIID)
{
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
}
}
nsPluginInstallerWizard.prototype.showLicense = function (){
var pluginInfo = this.mPluginInfoArray[this.mPluginLicenseArray[this.licenseAcceptCounter]];
this.canAdvance(false);
var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
document.getElementById("licenseIFrame").webNavigation.loadURI(pluginInfo.licenseURL, loadFlags, null, null, null);
document.getElementById("pluginLicenseLabel").firstChild.nodeValue =
this.getFormattedString("pluginLicenseAgreement.label", [pluginInfo.name]);
document.getElementById("licenseRadioGroup1").disabled = true;
document.getElementById("licenseRadioGroup2").disabled = true;
document.getElementById("licenseRadioGroup").selectedIndex =
pluginInfo.licenseAccepted ? 0 : 1;
}
nsPluginInstallerWizard.prototype.showNextLicense = function (){
var rv = true;
if (this.mPluginLicenseArray.length > 0) {
this.storeLicenseRadioGroup();
this.licenseAcceptCounter++;
if (this.licenseAcceptCounter < this.mPluginLicenseArray.length) {
this.showLicense();
rv = false;
this.canRewind(true);
}
}
return rv;
}
nsPluginInstallerWizard.prototype.showPreviousLicense = function (){
this.storeLicenseRadioGroup();
this.licenseAcceptCounter--;
if (this.licenseAcceptCounter > 0)
this.canRewind(true);
else
this.canRewind(false);
this.showLicense();
// don't allow to return from the license screens
return false;
}
nsPluginInstallerWizard.prototype.storeLicenseRadioGroup = function (){
var pluginInfo = this.mPluginInfoArray[this.mPluginLicenseArray[this.licenseAcceptCounter]];
pluginInfo.licenseAccepted = !document.getElementById("licenseRadioGroup").selectedIndex;
}
nsPluginInstallerWizard.prototype.licenseRadioGroupChange = function(aAccepted) {
// only if one plugin is to be installed should selection change the next button
if (this.pluginsToInstallNum == 1)
this.canAdvance(aAccepted);
}
nsPluginInstallerWizard.prototype.advancePage = function (aPageId){
this.canAdvance(true);
document.getElementById("plugin-installer-wizard").advance(aPageId);
}
nsPluginInstallerWizard.prototype.startPluginInstallation = function (){
this.canAdvance(false);
this.canRewind(false);
var installerPlugins = [];
var xpiPlugins = [];
for (var pluginInfoItem in this.mPluginInfoArray){
var pluginItem = this.mPluginInfoArray[pluginInfoItem];
if (pluginItem.toBeInstalled && pluginItem.licenseAccepted) {
if (pluginItem.InstallerLocation)
installerPlugins.push(pluginItem);
else if (pluginItem.XPILocation)
xpiPlugins.push(pluginItem);
}
}
if (installerPlugins.length > 0 || xpiPlugins.length > 0)
PluginInstallService.startPluginInstallation(installerPlugins,
xpiPlugins);
else
this.advancePage(null);
}
/*
0 starting download
1 download finished
2 starting installation
3 finished installation
4 all done
*/
nsPluginInstallerWizard.prototype.pluginInstallationProgress = function (aPid, aProgress, aError) {
var statMsg = null;
var pluginInfo = gPluginInstaller.mPluginInfoArray[aPid];
switch (aProgress) {
case 0:
statMsg = this.getFormattedString("pluginInstallation.download.start", [pluginInfo.name]);
break;
case 1:
statMsg = this.getFormattedString("pluginInstallation.download.finish", [pluginInfo.name]);
break;
case 2:
statMsg = this.getFormattedString("pluginInstallation.install.start", [pluginInfo.name]);
var progressElm = document.getElementById("plugin_install_progress");
progressElm.setAttribute("mode", "undetermined");
break;
case 3:
if (aError) {
statMsg = this.getFormattedString("pluginInstallation.install.error", [pluginInfo.name, aError]);
pluginInfo.error = aError;
} else {
statMsg = this.getFormattedString("pluginInstallation.install.finish", [pluginInfo.name]);
pluginInfo.error = null;
}
break;
case 4:
statMsg = this.getString("pluginInstallation.complete");
break;
}
if (statMsg)
document.getElementById("plugin_install_progress_message").value = statMsg;
if (aProgress == 4) {
this.advancePage(null);
}
}
nsPluginInstallerWizard.prototype.pluginInstallationProgressMeter = function (aPid, aValue, aMaxValue){
var progressElm = document.getElementById("plugin_install_progress");
if (progressElm.getAttribute("mode") == "undetermined")
progressElm.setAttribute("mode", "determined");
progressElm.setAttribute("value", Math.ceil((aValue / aMaxValue) * 100) + "%")
}
nsPluginInstallerWizard.prototype.addPluginResultRow = function (aImgSrc, aName, aNameTooltip, aStatus, aStatusTooltip, aManualUrl){
var myRows = document.getElementById("pluginResultList");
var myRow = document.createElement("row");
myRow.setAttribute("align", "center");
// create the image
var myImage = document.createElement("image");
myImage.setAttribute("src", aImgSrc);
myImage.setAttribute("height", "16px");
myImage.setAttribute("width", "16px");
myRow.appendChild(myImage)
// create the labels
var myLabel = document.createElement("label");
myLabel.setAttribute("value", aName);
if (aNameTooltip)
myLabel.setAttribute("tooltiptext", aNameTooltip);
myRow.appendChild(myLabel);
if (aStatus) {
myLabel = document.createElement("label");
myLabel.setAttribute("value", aStatus);
myRow.appendChild(myLabel);
}
// manual install
if (aManualUrl) {
var myButton = document.createElement("button");
var manualInstallLabel = this.getString("pluginInstallationSummary.manualInstall.label");
var manualInstallTooltip = this.getString("pluginInstallationSummary.manualInstall.tooltip");
myButton.setAttribute("label", manualInstallLabel);
myButton.setAttribute("tooltiptext", manualInstallTooltip);
myRow.appendChild(myButton);
// XXX: XUL sucks, need to add the listener after it got added into the document
if (aManualUrl)
myButton.addEventListener("command", function() { gPluginInstaller.loadURL(aManualUrl) }, false);
}
myRows.appendChild(myRow);
}
nsPluginInstallerWizard.prototype.showPluginResults = function (){
var notInstalledList = "?action=missingplugins";
var myRows = document.getElementById("pluginResultList");
// clear children
for (var run = myRows.childNodes.length; run--; run > 0)
myRows.removeChild(myRows.childNodes.item(run));
for (var pluginInfoItem in this.mPluginInfoArray){
// [plugin image] [Plugin_Name Plugin_Version] [Success/Failed] [Manual Install (if Failed)]
var myPluginItem = this.mPluginInfoArray[pluginInfoItem];
if (myPluginItem.toBeInstalled) {
var statusMsg;
var statusTooltip;
if (myPluginItem.error){
statusMsg = this.getString("pluginInstallationSummary.failed");
statusTooltip = myPluginItem.error;
notInstalledList += "&mimetype=" + pluginInfoItem;
} else if (!myPluginItem.licenseAccepted) {
statusMsg = this.getString("pluginInstallationSummary.licenseNotAccepted");
} else if (!myPluginItem.XPILocation && !myPluginItem.InstallerLocation) {
statusMsg = this.getString("pluginInstallationSummary.notAvailable");
notInstalledList += "&mimetype=" + pluginInfoItem;
} else {
this.mSuccessfullPluginInstallation++;
statusMsg = this.getString("pluginInstallationSummary.success");
// only check needsRestart if the plugin was successfully installed.
if (myPluginItem.needsRestart)
this.mNeedsRestart = true;
}
// manual url - either returned from the webservice or the pluginspage attribute
var manualUrl;
if ((myPluginItem.error || (!myPluginItem.XPILocation && !myPluginItem.InstallerLocation)) &&
(myPluginItem.manualInstallationURL || this.mPluginRequests.get(myPluginItem.requestedMimetype).pluginsPage)){
manualUrl = myPluginItem.manualInstallationURL ? myPluginItem.manualInstallationURL : this.mPluginRequests.get(myPluginItem.requestedMimetype).pluginsPage;
}
this.addPluginResultRow(
myPluginItem.IconUrl,
myPluginItem.name + " " + (myPluginItem.version ? myPluginItem.version : ""),
null,
statusMsg,
statusTooltip,
manualUrl);
}
}
// handle plugins we couldn't find
for (pluginInfoItem in this.mPluginNotFoundArray){
var pluginRequest = this.mPluginNotFoundArray[pluginInfoItem];
// if there is a pluginspage, show UI
if (pluginRequest.pluginsPage) {
this.addPluginResultRow(
"",
this.getFormattedString("pluginInstallation.unknownPlugin", [pluginInfoItem]),
null,
null,
null,
pluginRequest.pluginsPage);
}
notInstalledList += "&mimetype=" + pluginInfoItem;
}
// no plugins were found, so change the description of the final page.
if (this.mPluginInfoArrayLength == 0) {
var noPluginsFound = this.getString("pluginInstallation.noPluginsFound");
document.getElementById("pluginSummaryDescription").setAttribute("value", noPluginsFound);
} else if (this.mSuccessfullPluginInstallation == 0) {
// plugins found, but none were installed.
var noPluginsInstalled = this.getString("pluginInstallation.noPluginsInstalled");
document.getElementById("pluginSummaryDescription").setAttribute("value", noPluginsInstalled);
}
document.getElementById("pluginSummaryRestartNeeded").hidden = !this.mNeedsRestart;
var app = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
// set the get more info link to contain the mimetypes we couldn't install.
notInstalledList +=
"&appID=" + app.ID +
"&appVersion=" + app.platformBuildID +
"&clientOS=" + this.getOS() +
"&chromeLocale=" + this.getChromeLocale() +
"&appRelease=" + app.version;
document.getElementById("moreInfoLink").addEventListener("click", function() { gPluginInstaller.loadURL("https://pfs.mozilla.org/plugins/" + notInstalledList) }, false);
if (this.mNeedsRestart) {
var cancel = document.getElementById("plugin-installer-wizard").getButton("cancel");
cancel.label = this.getString("pluginInstallation.close.label");
cancel.accessKey = this.getString("pluginInstallation.close.accesskey");
var finish = document.getElementById("plugin-installer-wizard").getButton("finish");
finish.label = this.getFormattedString("pluginInstallation.restart.label", [app.name]);
finish.accessKey = this.getString("pluginInstallation.restart.accesskey");
this.canCancel(true);
}
else {
this.canCancel(false);
}
this.canAdvance(true);
this.canRewind(false);
}
nsPluginInstallerWizard.prototype.loadURL = function (aUrl){
// Check if the page where the plugin came from can load aUrl before
// loading it, and do *not* allow loading URIs that would inherit our
// principal.
var pluginPagePrincipal =
window.opener.content.document.nodePrincipal;
const nsIScriptSecurityManager =
Components.interfaces.nsIScriptSecurityManager;
var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
.getService(nsIScriptSecurityManager);
secMan.checkLoadURIStrWithPrincipal(pluginPagePrincipal, aUrl,
nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
window.opener.open(aUrl);
}
nsPluginInstallerWizard.prototype.getString = function (aName){
return document.getElementById("pluginWizardString").getString(aName);
}
nsPluginInstallerWizard.prototype.getFormattedString = function (aName, aArray){
return document.getElementById("pluginWizardString").getFormattedString(aName, aArray);
}
nsPluginInstallerWizard.prototype.getOS = function (){
var httpService = Components.classes["@mozilla.org/network/protocol;1?name=http"]
.getService(Components.interfaces.nsIHttpProtocolHandler);
return httpService.oscpu;
}
nsPluginInstallerWizard.prototype.getChromeLocale = function (){
var chromeReg = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIXULChromeRegistry);
return chromeReg.getSelectedLocale("global");
}
nsPluginInstallerWizard.prototype.getPrefBranch = function (){
if (!this.prefBranch)
this.prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
return this.prefBranch;
}
function nsPluginRequest(aPlugRequest){
this.mimetype = encodeURI(aPlugRequest.mimetype);
this.pluginsPage = aPlugRequest.pluginsPage;
}
function PluginInfo(aResult) {
this.name = aResult.name;
this.pid = aResult.pid;
this.version = aResult.version;
this.IconUrl = aResult.IconUrl;
this.InstallerLocation = aResult.InstallerLocation;
this.InstallerHash = aResult.InstallerHash;
this.XPILocation = aResult.XPILocation;
this.XPIHash = aResult.XPIHash;
this.InstallerShowsUI = aResult.InstallerShowsUI;
this.manualInstallationURL = aResult.manualInstallationURL;
this.requestedMimetype = aResult.requestedMimetype;
this.licenseURL = aResult.licenseURL;
this.needsRestart = (aResult.needsRestart == "true");
this.error = null;
this.toBeInstalled = true;
// no license provided, make it accepted
this.licenseAccepted = this.licenseURL ? false : true;
}
var gPluginInstaller;
function wizardInit(){
gPluginInstaller = new nsPluginInstallerWizard();
gPluginInstaller.canAdvance(false);
gPluginInstaller.getPluginData();
}
function wizardFinish(){
if (gPluginInstaller.mNeedsRestart) {
// Notify all windows that an application quit has been requested.
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
.createInstance(Components.interfaces.nsISupportsPRBool);
os.notifyObservers(cancelQuit, "quit-application-requested", "restart");
// Something aborted the quit process.
if (!cancelQuit.data) {
var nsIAppStartup = Components.interfaces.nsIAppStartup;
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
.getService(nsIAppStartup);
appStartup.quit(nsIAppStartup.eAttemptQuit | nsIAppStartup.eRestart);
return true;
}
}
// don't refresh if no plugins were found or installed
if ((gPluginInstaller.mSuccessfullPluginInstallation > 0) &&
(gPluginInstaller.mPluginInfoArray.length != 0)) {
// reload plugins so JS detection works immediately
try {
var ph = Components.classes["@mozilla.org/plugin/host;1"]
.getService(Components.interfaces.nsIPluginHost);
ph.reloadPlugins(false);
}
catch (e) {
// reloadPlugins throws an exception if there were no plugins to load
}
if (gPluginInstaller.mBrowser) {
// notify listeners that a plugin is installed,
// so that they can reset the UI and update the browser.
var event = document.createEvent("Events");
event.initEvent("NewPluginInstalled", true, true);
gPluginInstaller.mBrowser.dispatchEvent(event);
}
}
return true;
}

Просмотреть файл

@ -1,115 +0,0 @@
<?xml version="1.0"?>
<!-- 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/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/plugins/pluginInstallerWizard.css"?>
<?xml-stylesheet href="chrome://mozapps/skin/plugins/pluginInstallerWizard.css"?>
<!DOCTYPE wizard [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % pluginsDTD SYSTEM "chrome://mozapps/locale/plugins/plugins.dtd">
%pluginsDTD;
]>
<wizard id="plugin-installer-wizard" title="&pluginWizard.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
persist="width height screenX screenY sizemode"
style="width: 50em; min-height: 40em;"
onload="wizardInit()"
onwizardfinish="return wizardFinish();">
<script type="application/javascript" src="chrome://mozapps/content/plugins/pluginInstallerWizard.js"/>
<script type="application/javascript" src="chrome://mozapps/content/plugins/pluginInstallerDatasource.js"/>
<script type="application/javascript" src="chrome://mozapps/content/plugins/pluginInstallerService.js"/>
<stringbundleset id="pluginSet">
<stringbundle id="brandStrings" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="xpinstallStrings" src="chrome://global/locale/xpinstall/xpinstall.properties"/>
<stringbundle id="pluginWizardString" src="chrome://mozapps/locale/plugins/plugins.properties"/>
</stringbundleset>
<wizardpage label="&pluginWizard.firstPage.title;">
<description value="&pluginWizard.checkingForPlugins.description.label;"/>
<separator />
<progressmeter id="ws_request_progress" mode="undetermined"/>
</wizardpage>
<wizardpage label="&pluginWizard.availablePluginsPage.title;"
onpageshow="gPluginInstaller.showPluginList()">
<description value="&pluginWizard.availablePluginsPage.description.label;"/>
<vbox id="pluginList" flex="1" align="left" style="overflow: auto;"/>
<vbox id="installerUI" hidden="true">
<separator />
<description>&pluginWizard.availablePluginsPage.installerUI;</description>
</vbox>
<separator />
<description value="&pluginWizard.availablePluginsPage.continueMsg.label;"/>
</wizardpage>
<wizardpage label="&pluginWizard.licensePage.title;"
onpageshow="gPluginInstaller.showLicenses()"
onpageadvanced="return gPluginInstaller.showNextLicense();"
onpagerewound="return gPluginInstaller.showPreviousLicense();">
<description id="pluginLicenseLabel"> </description>
<vbox id="licenseContainer" flex="1">
<iframe id="licenseIFrame" flex="1" src="" />
</vbox>
<radiogroup id="licenseRadioGroup">
<radio id="licenseRadioGroup1" disabled="true"
oncommand="gPluginInstaller.licenseRadioGroupChange(true)"
label="&pluginWizard.licensePage.accept.label;"/>
<radio id="licenseRadioGroup2" disabled="true" selected="true"
oncommand="gPluginInstaller.licenseRadioGroupChange(false)"
label="&pluginWizard.licensePage.deny.label;"/>
</radiogroup>
</wizardpage>
<wizardpage label="&pluginWizard.installPluginsPage.title;"
onpageshow="gPluginInstaller.startPluginInstallation()">
<description value="&pluginWizard.installPluginsPage.description.label;"/>
<separator />
<description id="plugin_install_progress_message" value=""/>
<progressmeter id="plugin_install_progress" mode="undetermined"/>
</wizardpage>
<wizardpage id="lastpage" pageid="lastpage"
onpageshow="gPluginInstaller.showPluginResults()">
<description id="pluginSummaryDescription"
value="&pluginWizard.finalPage.description.label;"/>
<separator />
<grid class="indent">
<columns>
<column/>
<column style="margin-right:15px;"/>
<column style="margin-right:15px;"/>
<column />
</columns>
<rows id="pluginResultList">
</rows>
</grid>
<description id="pluginSummaryRestartNeeded" style="padding-top:10px;"
value="&pluginWizard.finalPage.restart.label;"/>
<spacer flex="1" />
<description id="moreInfoLink"
style="color:rgb(0, 0, 255); cursor:pointer; text-decoration:underline;"
value="&pluginWizard.finalPage.moreInfo.label;"/>
</wizardpage>
</wizard>

Просмотреть файл

@ -41,11 +41,6 @@
<html:div class="msgReload">&reloadPlugin.pre;<html:a class="reloadLink" anonid="reloadLink" href="">&reloadPlugin.middle;</html:a>&reloadPlugin.post;</html:div>
</html:div>
<html:div class="installStatus" anonid="installStatus">
<html:div class="msg msgInstallPlugin">
<html:a class="action-link" anonid="installPluginLink" href="">&installPlugin;</html:a>
</html:div>
</html:div>
<html:div class="msg msgManagePlugins"><html:a class="action-link" anonid="managePluginsLink" href="">&managePlugins;</html:a></html:div>
<html:div class="submitStatus" anonid="submitStatus">
<html:div class="msg msgPleaseSubmit" anonid="pleaseSubmit">

Просмотреть файл

@ -125,10 +125,6 @@ html|applet:not([height]), html|applet[height=""] {
display: block;
}
.installStatus[installable] .msgInstallPlugin {
display: block;
}
.submitStatus[status] {
display: -moz-box;
-moz-box-align: center;

Просмотреть файл

@ -4,11 +4,6 @@
toolkit.jar:
% content mozapps %content/mozapps/
content/mozapps/plugins/pluginInstallerWizard.xul (content/pluginInstallerWizard.xul)
content/mozapps/plugins/pluginInstallerWizard.js (content/pluginInstallerWizard.js)
content/mozapps/plugins/pluginInstallerWizard.css (content/pluginInstallerWizard.css)
content/mozapps/plugins/pluginInstallerDatasource.js (content/pluginInstallerDatasource.js)
content/mozapps/plugins/pluginInstallerService.js (content/pluginInstallerService.js)
content/mozapps/plugins/pluginProblem.xml (content/pluginProblem.xml)
content/mozapps/plugins/pluginProblemContent.css (content/pluginProblemContent.css)
content/mozapps/plugins/pluginProblemBinding.css (content/pluginProblemBinding.css)

Просмотреть файл

@ -4,10 +4,8 @@
# 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/.
TEST_DIRS += ['tests']
EXTRA_COMPONENTS += [
'pluginGlue.manifest',
]
JAR_MANIFESTS += ['jar.mn']
JAR_MANIFESTS += ['jar.mn']

Просмотреть файл

@ -1,40 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
package org.mozilla.pfs;
public class PluginFinderService {
public org.mozilla.pfs.PluginInfo getPluginInfo(java.lang.String aMimetype, java.lang.String aClientOS, java.lang.String aLocale) {
org.mozilla.pfs.PluginInfo response = new org.mozilla.pfs.PluginInfo();
if (aMimetype.equals("application/x-shockwave-flash")) {
response.setPid(1);
response.setName("Flash Player");
response.setVersion("7");
response.setIconUrl("http://goat.austin.ibm.com:8080/flash.gif");
response.setXPILocation("http://www.nexgenmedia.net/flashlinux/flash-linux.xpi");
response.setInstallerShowsUI(false);
response.setManualInstallationURL("");
response.setLicenseURL("");
} else if (aMimetype.equals("application/x-mtx")) {
response.setPid(2);
response.setName("Viewpoint Media Player");
response.setVersion("5");
response.setIconUrl(null);
response.setXPILocation("http://www.nexgenmedia.net/flashlinux/invalid.xpi");
response.setInstallerShowsUI(false);
response.setManualInstallationURL("http://www.viewpoint.com/pub/products/vmp.html");
response.setLicenseURL("http://www.viewpoint.com/pub/privacy.html");
} else {
response.setPid(-1);
}
response.setRequestedMimetype(aMimetype);
return response;
}
}

Просмотреть файл

@ -1,163 +0,0 @@
<?php
/* -*- Mode: php; 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/. */
/// config bits:
$db_server = "";
$db_user = "";
$db_pass = "";
$db_name = "";
// error handling
function bail ($errstr) {
die("Error: " . $errstr);
}
// major.minor.release.build[+]
// make sure this is a valid version
function expandversion ($vstr) {
$v = explode('.', $vstr);
if ($vstr == '' || count($v) == 0 || count($v) > 4) {
bail ('Bogus version.');
}
$vlen = count($v);
$ret = array();
$hasplus = 0;
for ($i = 0; $i < 4; $i++) {
if ($i > $vlen-1) {
// this version chunk was not specified; give 0
$ret[] = 0;
} else {
$s = $v[$i];
if ($i == 3) {
// need to check for +
$slen = strlen($s);
if ($s{$slen-1} == '+') {
$s = substr($s, 0, $slen-1);
$hasplus = 1;
}
}
$ret[] = intval($s);
}
}
$ret[] = $hasplus;
return $ret;
}
function vercmp ($a, $b) {
if ($a == $b)
return 0;
$va = expandversion($a);
$vb = expandversion($b);
for ($i = 0; $i < 5; $i++)
if ($va[$i] != $vb[$i])
return ($vb[$i] - $va[$i]);
return 0;
}
//
// These are passed in the GET string
//
if (!array_key_exists('mimetype', $_GET))
bail ("Invalid request.");
$mimetype = $_GET['mimetype'];
if (!array_key_exists('appID', $_GET)
|| !array_key_exists('appVersion', $_GET)
|| !array_key_exists('clientOS', $_GET))
|| !array_key_exists('chromeLocale', $_GET))
)
bail ("Invalid request.");
$reqTargetAppGuid = $_GET['appID'];
$reqTargetAppVersion = $_GET['appVersion'];
$clientOS = $_GET['clientOS'];
$chromeLocale = $_GET['chromeLocale'];
// check args
if (empty($reqTargetAppVersion) || empty($reqTargetAppGuid)) {
bail ("Invalid request.");
}
//
// Now to spit out the RDF. We hand-generate because the data is pretty simple.
//
if ($mimetype == "application/x-mtx") {
$name = "Viewpoint Media Player";
$guid = "{03F998B2-0E00-11D3-A498-00104B6EB52E}";
$version = "5.0";
$iconUrl = "";
$XPILocation = "http://www.nexgenmedia.net/flashlinux/invalid.xpi";
$InstallerShowsUI = false;
$manualInstallationURL = "http://www.viewpoint.com/pub/products/vmp.html";
$licenseURL = "http://www.viewpoint.com/pub/privacy.html";
} else if ($mimetype == "application/x-shockwave-flash") {
$name = "Flash Player";
$guid = "{D27CDB6E-AE6D-11cf-96B8-444553540000}";
$version = "7.0.16";
$iconUrl = "http://goat.austin.ibm.com:8080/flash.gif";
$XPILocation = "http://www.nexgenmedia.net/flashlinux/flash-linux.xpi";
$InstallerShowsUI = "false";
$manualInstallationURL = "http://www.macromedia.com/go/getflashplayer";
$licenseURL = "http://www.macromedia.com/shockwave/download/license/desktop/";
} else {
$name = "";
$guid = "-1";
$version = "";
$iconUrl = "";
$XPILocation = "";
$InstallerShowsUI = "";
$manualInstallationURL = "";
$licenseURL = "";
}
header("Content-type: application/xml");
print "<?xml version=\"1.0\"?>\n";
print "<RDF:RDF xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:pfs=\"http://www.mozilla.org/2004/pfs-rdf#\">\n\n";
print "<RDF:Description about=\"urn:mozilla:plugin-results:{$mimetype}\">\n";
// output list of matching plugins
print " <pfs:plugins><RDF:Seq>\n";
print " <RDF:li resource=\"urn:mozilla:plugin:{$guid}\"/>\n";
print " </RDF:Seq></pfs:plugins>\n";
print "</RDF:Description>\n\n";
print "<RDF:Description about=\"urn:mozilla:plugin:{$guid}\">\n";
print " <pfs:updates><RDF:Seq>\n";
print " <RDF:li resource=\"urn:mozilla:plugin:{$guid}:{$version}\"/>\n";
print " </RDF:Seq></pfs:updates>\n";
print "</RDF:Description>\n\n";
print "<RDF:Description about=\"urn:mozilla:plugin:{$guid}:{$version}\">\n";
print " <pfs:name>{$name}</pfs:name>\n";
print " <pfs:requestedMimetype>{$mimetype}</pfs:requestedMimetype>\n";
print " <pfs:guid>{$guid}</pfs:guid>\n";
print " <pfs:version>{$version}</pfs:version>\n";
print " <pfs:IconUrl>{$iconUrl}</pfs:IconUrl>\n";
print " <pfs:XPILocation>{$XPILocation}</pfs:XPILocation>\n";
print " <pfs:InstallerShowsUI>{$InstallerShowsUI}</pfs:InstallerShowsUI>\n";
print " <pfs:manualInstallationURL>{$manualInstallationURL}</pfs:manualInstallationURL>\n";
print " <pfs:licenseURL>{$licenseURL}</pfs:licenseURL>\n";
print "</RDF:Description>\n\n";
print "</RDF:RDF>\n";
?>

Просмотреть файл

@ -1,94 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
package org.mozilla.pfs;
public class PluginInfo {
private java.lang.String name;
private int pid;
private java.lang.String version;
private java.lang.String iconUrl;
private java.lang.String XPILocation;
private boolean installerShowsUI;
private java.lang.String manualInstallationURL;
private java.lang.String requestedMimetype;
private java.lang.String licenseURL;
public PluginInfo() {
}
public java.lang.String getName() {
return name;
}
public void setName(java.lang.String name) {
this.name = name;
}
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public java.lang.String getVersion() {
return version;
}
public void setVersion(java.lang.String version) {
this.version = version;
}
public java.lang.String getIconUrl() {
return iconUrl;
}
public void setIconUrl(java.lang.String iconUrl) {
this.iconUrl = iconUrl;
}
public java.lang.String getXPILocation() {
return XPILocation;
}
public void setXPILocation(java.lang.String XPILocation) {
this.XPILocation = XPILocation;
}
public boolean isInstallerShowsUI() {
return installerShowsUI;
}
public void setInstallerShowsUI(boolean installerShowsUI) {
this.installerShowsUI = installerShowsUI;
}
public java.lang.String getManualInstallationURL() {
return manualInstallationURL;
}
public void setManualInstallationURL(java.lang.String manualInstallationURL) {
this.manualInstallationURL = manualInstallationURL;
}
public java.lang.String getRequestedMimetype() {
return requestedMimetype;
}
public void setRequestedMimetype(java.lang.String requestedMimetype) {
this.requestedMimetype = requestedMimetype;
}
public java.lang.String getLicenseURL() {
return licenseURL;
}
public void setLicenseURL(java.lang.String licenseURL) {
this.licenseURL = licenseURL;
}
}

Просмотреть файл

@ -1,50 +0,0 @@
#!/bin/sh
# 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/.
export CATALINA_HOME=/var/tomcat-4.1.27
export AXIS_HOME=/var/tomcat-4.1.27/axis-1_1
export CLASSPATH=$AXIS_HOME/lib/axis.jar:$AXIS_HOME/lib/commons-discovery.jar:$AXIS_HOME/lib/commons-logging.jar:$AXIS_HOME/lib/jaxrpc.jar:$AXIS_HOME/lib/saaj.jar:$AXIS_HOME/lib/log4j-1.2.4.jar:$AXIS_HOME/lib/wsdl4j.jar:$CATALINA_HOME/webapps/axis/WEB-INF/classes
name="PluginFinderService"
pkg="org.mozilla.pfs"
pkg_dir=$CATALINA_HOME/webapps/axis/WEB-INF/classes/org/mozilla/pfs
echo "Copying Source..."
rm -f $pkg_dir/*.*
cp -f *.java $pkg_dir
echo "Compiling Source..."
javac -g $pkg_dir/*.java
echo "Generating WSDL..."
java org.apache.axis.wsdl.Java2WSDL -o $name.wsdl \
-l"http://localhost:8080/axis/services/$name" \
-n "urn:$name" -p"$pkg" "urn:$name" $pkg.$name
echo "Generating Stubs from WSDL..."
rm -f org/mozilla/pfs/*.*
java org.apache.axis.wsdl.WSDL2Java -o . -s -S true -Nurn:$name $pkg $name.wsdl
# make our PluginFinderService.java looking the SoapBindingImpl syntax and replace
cp $name.java $name.temp
regexp="s/$name/${name}SoapBindingImpl/g"
sed -e $regexp $name.temp > $name.temp2
rm $name.temp
regexp="s/public class ${name}SoapBindingImpl/public class ${name}SoapBindingImpl implements ${pkg}.${name}/g"
sed -e "$regexp" $name.temp2 > $name.temp
rm $name.temp2
mv $name.temp org/mozilla/pfs/${name}SoapBindingImpl.java
rm -f $pkg_dir/*.java
cp org/mozilla/pfs/* $pkg_dir/
javac $pkg_dir/*.java
echo "Deploying Web Service..."
java org.apache.axis.client.AdminClient -p 8080 $pkg_dir/deploy.wsdd
echo "All Done. Hoorah!"

Двоичные данные
toolkit/mozapps/plugins/tests/BadExtension.xpi

Двоичный файл не отображается.

Просмотреть файл

@ -1,4 +0,0 @@
int main(int argc, char** argv)
{
return 1;
}

Двоичные данные
toolkit/mozapps/plugins/tests/GoodExtension.xpi

Двоичный файл не отображается.

Просмотреть файл

@ -1,4 +0,0 @@
int main(int argc, char** argv)
{
return 0;
}

Просмотреть файл

@ -1,9 +0,0 @@
# 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/.
TESTROOT = $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
PROGRAMS_DEST = $(TESTROOT)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1,9 +0,0 @@
[DEFAULT]
support-files =
pfs_bug435788_1.rdf
pfs_bug435788_2.rdf
GoodExtension.xpi
BadExtension.xpi
[browser_bug435788.js]
disabled = disabled for leaks--bug-751100

Просмотреть файл

@ -1,461 +0,0 @@
const TEST_ROOT = "http://example.com/browser/toolkit/mozapps/plugins/tests/";
let tmp = {};
Components.utils.import("resource://gre/modules/AddonManager.jsm", tmp);
let AddonManager = tmp.AddonManager;
var gPFS;
function test() {
waitForExplicitFinish();
prepare_test_1();
}
function finishTest() {
Services.prefs.clearUserPref("pfs.datasource.url");
finish();
}
// Gets the number of plugin items in the detected list
function getListCount() {
var list = gPFS.document.getElementById("pluginList");
return list.childNodes.length;
}
// Gets wether the list contains a particular plugin name
function hasListItem(name, version) {
var label = name + " " + (version ? version : "");
var list = gPFS.document.getElementById("pluginList");
for (var i = 0; i < list.childNodes.length; i++) {
if (list.childNodes[i].label == label)
return true;
}
return false;
}
// Gets the number of plugin results
function getResultCount() {
var list = gPFS.document.getElementById("pluginResultList");
return list.childNodes.length;
}
// Gets the plugin result for a particular plugin name
function getResultItem(name, version) {
var label = name + " " + (version ? version : "");
var list = gPFS.document.getElementById("pluginResultList");
for (var i = 0; i < list.childNodes.length; i++) {
if (list.childNodes[i].childNodes[1].value == label) {
var item = {
name: name,
version: version,
status: null
};
if (list.childNodes[i].childNodes[2].tagName == "label")
item.status = list.childNodes[i].childNodes[2].value;
return item;
}
}
return null;
}
// Logs the currently displaying wizard page
function page_shown() {
function show_button_state(name) {
var button = gPFS.document.documentElement.getButton(name);
info("Button " + name + ". hidden: " + button.hidden +
", disabled: " + button.disabled);
}
info("Page shown: " +
gPFS.document.documentElement.currentPage.getAttribute("label"));
show_button_state("next");
show_button_state("finish");
}
function pfs_loaded() {
info("PFS loaded");
var docEle = gPFS.document.documentElement;
var onwizardfinish = function () {
info("wizardfinish event");
};
var onwizardnext = function () {
info("wizardnext event");
};
docEle.addEventListener("pageshow", page_shown, false);
docEle.addEventListener("wizardfinish", onwizardfinish, false);
docEle.addEventListener("wizardnext", onwizardnext, false);
gPFS.addEventListener("unload", function() {
info("unload event");
gPFS.removeEventListener("unload", arguments.callee, false);
docEle.removeEventListener("pageshow", page_shown, false);
docEle.removeEventListener("wizardfinish", onwizardfinish, false);
docEle.removeEventListener("wizardnext", onwizardnext, false);
}, false);
page_shown();
}
function startTest(num, missingPluginsArray) {
info("Test " + num);
gPFS = window.openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: missingPluginsArray});
var testScope = this;
gPFS.addEventListener("load", function () {
gPFS.removeEventListener("load", arguments.callee, false);
pfs_loaded();
var seenAvailable = false;
var expectAvailable = typeof testScope["test_" + num + "_available"] == "function";
function availableListener() {
seenAvailable = true;
if (expectAvailable) {
executeSoon(function () {
testScope["test_" + num + "_available"]();
gPFS.document.documentElement.getButton("next").click();
});
} else {
ok(false, "Should not have found plugins to install");
}
}
function completeListener() {
if (expectAvailable)
ok(seenAvailable, "Should have seen the list of available plugins");
executeSoon(testScope["test_" + num + "_complete"]);
}
gPFS.document.documentElement.wizardPages[1].addEventListener("pageshow", availableListener);
gPFS.document.documentElement.wizardPages[4].addEventListener("pageshow", completeListener);
gPFS.addEventListener("unload", function () {
gPFS.removeEventListener("unload", arguments.callee, false);
gPFS.document.documentElement.wizardPages[1].removeEventListener("pageshow", availableListener, false);
gPFS.document.documentElement.wizardPages[4].removeEventListener("pageshow", completeListener, false);
num++;
if (typeof testScope["prepare_test_" + num] == "function")
testScope["prepare_test_" + num]();
else
finishTest();
});
});
}
function clickFinish() {
var finish = gPFS.document.documentElement.getButton("finish");
ok(!finish.hidden, "Finish button should not be hidden");
ok(!finish.disabled, "Finish button should not be disabled");
finish.click();
}
// Test a working installer
function prepare_test_1() {
Services.prefs.setCharPref("pfs.datasource.url", TEST_ROOT + "pfs_bug435788_1.rdf");
var missingPluginsArray = {
"application/x-working-plugin": {
mimetype: "application/x-working-plugin",
pluginsPage: ""
}
};
startTest(1, missingPluginsArray);
}
function test_1_available() {
is(getListCount(), 1, "Should have found 1 plugin to install");
ok(hasListItem("Test plugin 1", null), "Should have seen the right plugin name");
}
function test_1_complete() {
is(getResultCount(), 1, "Should have attempted to install 1 plugin");
var item = getResultItem("Test plugin 1", null);
ok(item, "Should have seen the installed item");
is(item.status, "Installed", "Should have been a successful install");
clickFinish();
}
// Test a broken installer (returns exit code 1)
function prepare_test_2() {
var missingPluginsArray = {
"application/x-broken-installer": {
mimetype: "application/x-broken-installer",
pluginsPage: ""
}
};
startTest(2, missingPluginsArray);
}
function test_2_available() {
is(getListCount(), 1, "Should have found 1 plugin to install");
ok(hasListItem("Test plugin 2", null), "Should have seen the right plugin name");
}
function test_2_complete() {
is(getResultCount(), 1, "Should have attempted to install 1 plugin");
var item = getResultItem("Test plugin 2", null);
ok(item, "Should have seen the installed item");
is(item.status, "Failed", "Should have been a failed install");
clickFinish();
}
// Test both working and broken together
function prepare_test_3() {
var missingPluginsArray = {
"application/x-working-plugin": {
mimetype: "application/x-working-plugin",
pluginsPage: ""
},
"application/x-broken-installer": {
mimetype: "application/x-broken-installer",
pluginsPage: ""
}
};
startTest(3, missingPluginsArray);
}
function test_3_available() {
is(getListCount(), 2, "Should have found 2 plugins to install");
ok(hasListItem("Test plugin 1", null), "Should have seen the right plugin name");
ok(hasListItem("Test plugin 2", null), "Should have seen the right plugin name");
}
function test_3_complete() {
is(getResultCount(), 2, "Should have attempted to install 2 plugins");
var item = getResultItem("Test plugin 1", null);
ok(item, "Should have seen the installed item");
is(item.status, "Installed", "Should have been a successful install");
item = getResultItem("Test plugin 2", null);
ok(item, "Should have seen the installed item");
is(item.status, "Failed", "Should have been a failed install");
clickFinish();
}
// Test an installer with a bad hash
function prepare_test_4() {
var missingPluginsArray = {
"application/x-broken-plugin-hash": {
mimetype: "application/x-broken-plugin-hash",
pluginsPage: ""
}
};
startTest(4, missingPluginsArray);
}
function test_4_available() {
is(getListCount(), 1, "Should have found 1 plugin to install");
ok(hasListItem("Test plugin 3", null), "Should have seen the right plugin name");
}
function test_4_complete() {
is(getResultCount(), 1, "Should have attempted to install 1 plugin");
var item = getResultItem("Test plugin 3", null);
ok(item, "Should have seen the installed item");
is(item.status, "Failed", "Should have not been a successful install");
clickFinish();
}
// Test a working xpi
function prepare_test_5() {
var missingPluginsArray = {
"application/x-working-extension": {
mimetype: "application/x-working-extension",
pluginsPage: ""
}
};
startTest(5, missingPluginsArray);
}
function test_5_available() {
is(getListCount(), 1, "Should have found 1 plugin to install");
ok(hasListItem("Test extension 1", null), "Should have seen the right plugin name");
}
function test_5_complete() {
is(getResultCount(), 1, "Should have attempted to install 1 plugin");
var item = getResultItem("Test extension 1", null);
ok(item, "Should have seen the installed item");
is(item.status, "Installed", "Should have been a successful install");
AddonManager.getAllInstalls(function(installs) {
is(installs.length, 1, "Should be just one install");
is(installs[0].state, AddonManager.STATE_INSTALLED, "Should be fully installed");
is(installs[0].addon.id, "bug435788_1@tests.mozilla.org", "Should have installed the extension");
installs[0].cancel();
clickFinish();
});
}
// Test a broke xpi (no install.rdf)
function prepare_test_6() {
var missingPluginsArray = {
"application/x-broken-extension": {
mimetype: "application/x-broken-extension",
pluginsPage: ""
}
};
startTest(6, missingPluginsArray);
}
function test_6_available() {
is(getListCount(), 1, "Should have found 1 plugin to install");
ok(hasListItem("Test extension 2", null), "Should have seen the right plugin name");
}
function test_6_complete() {
is(getResultCount(), 1, "Should have attempted to install 1 plugin");
var item = getResultItem("Test extension 2", null);
ok(item, "Should have seen the installed item");
is(item.status, "Failed", "Should have been a failed install");
clickFinish();
}
// Test both working and broken xpi
function prepare_test_7() {
var missingPluginsArray = {
"application/x-working-extension": {
mimetype: "application/x-working-extension",
pluginsPage: ""
},
"application/x-broken-extension": {
mimetype: "application/x-broken-extension",
pluginsPage: ""
}
};
startTest(7, missingPluginsArray);
}
function test_7_available() {
is(getListCount(), 2, "Should have found 2 plugins to install");
ok(hasListItem("Test extension 1", null), "Should have seen the right plugin name");
ok(hasListItem("Test extension 2", null), "Should have seen the right plugin name");
}
function test_7_complete() {
is(getResultCount(), 2, "Should have attempted to install 2 plugins");
var item = getResultItem("Test extension 1", null);
ok(item, "Should have seen the installed item");
is(item.status, "Installed", "Should have been a failed install");
item = getResultItem("Test extension 2", null);
ok(item, "Should have seen the installed item");
is(item.status, "Failed", "Should have been a failed install");
AddonManager.getAllInstalls(function(installs) {
is(installs.length, 1, "Should be one active installs");
installs[0].cancel();
clickFinish();
});
}
// Test an xpi with a bad hash
function prepare_test_8() {
var missingPluginsArray = {
"application/x-broken-extension-hash": {
mimetype: "application/x-broken-extension-hash",
pluginsPage: ""
}
};
startTest(8, missingPluginsArray);
}
function test_8_available() {
is(getListCount(), 1, "Should have found 1 plugin to install");
ok(hasListItem("Test extension 3", null), "Should have seen the right plugin name");
}
function test_8_complete() {
is(getResultCount(), 1, "Should have attempted to install 1 plugin");
var item = getResultItem("Test extension 3", null);
ok(item, "Should have seen the installed item");
is(item.status, "Failed", "Should have not been a successful install");
AddonManager.getAllInstalls(function(installs) {
is(installs.length, 0, "Should not be any installs");
clickFinish();
});
}
// Test when no plugin exists in the datasource
function prepare_test_9() {
var missingPluginsArray = {
"application/x-unknown-plugin": {
mimetype: "application/x-unknown-plugin",
pluginsPage: ""
}
};
startTest(9, missingPluginsArray);
}
function test_9_complete() {
is(getResultCount(), 0, "Should have found no plugins");
clickFinish();
}
// Test when the datasource is invalid xml
function prepare_test_10() {
Services.prefs.setCharPref("pfs.datasource.url", TEST_ROOT + "pfs_bug435788_2.rdf");
var missingPluginsArray = {
"application/x-broken-xml": {
mimetype: "application/x-broken-xml",
pluginsPage: ""
}
};
startTest(10, missingPluginsArray);
}
function test_10_complete() {
is(getResultCount(), 0, "Should have found no plugins");
clickFinish();
}
// Test when no datasource is returned
function prepare_test_11() {
Services.prefs.setCharPref("pfs.datasource.url", TEST_ROOT + "pfs_bug435788_foo.rdf");
var missingPluginsArray = {
"application/x-missing-xml": {
mimetype: "application/x-missing-xml",
pluginsPage: ""
}
};
startTest(11, missingPluginsArray);
}
function test_11_complete() {
is(getResultCount(), 0, "Should have found no plugins");
clickFinish();
}

Просмотреть файл

@ -1,13 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
SimplePrograms([
'BadPlugin',
'GoodPlugin',
])
BROWSER_CHROME_MANIFESTS += ['browser.ini']
USE_STATIC_LIBS = True

Просмотреть файл

@ -1,161 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pfs="http://www.mozilla.org/2004/pfs-rdf#">
<RDF:Description about="urn:mozilla:plugin-results:application/x-working-plugin">
<pfs:plugins><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{8d3ab839-e03e-41a5-acd3-be1eabf94810}"/>
</RDF:Seq></pfs:plugins>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{8d3ab839-e03e-41a5-acd3-be1eabf94810}">
<pfs:updates><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{8d3ab839-e03e-41a5-acd3-be1eabf94810}:"/>
</RDF:Seq></pfs:updates>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{8d3ab839-e03e-41a5-acd3-be1eabf94810}:">
<pfs:name>Test plugin 1</pfs:name>
<pfs:requestedMimetype>application/x-working-plugin</pfs:requestedMimetype>
<pfs:guid>{8d3ab839-e03e-41a5-acd3-be1eabf94810}</pfs:guid>
<pfs:version/>
<pfs:IconUrl/>
<pfs:InstallerLocation>http://example.com/browser/toolkit/mozapps/plugins/tests/GoodPlugin</pfs:InstallerLocation>
<pfs:InstallerHash/>
<pfs:InstallerShowsUI>false</pfs:InstallerShowsUI>
<pfs:manualInstallationURL>http://www.mozilla.com</pfs:manualInstallationURL>
<pfs:licenseURL/>
<pfs:needsRestart>false</pfs:needsRestart>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin-results:application/x-broken-installer">
<pfs:plugins><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{949a51e0-c633-4d9e-bf3a-6e0c2bc6e508}"/>
</RDF:Seq></pfs:plugins>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{949a51e0-c633-4d9e-bf3a-6e0c2bc6e508}">
<pfs:updates><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{949a51e0-c633-4d9e-bf3a-6e0c2bc6e508}:"/>
</RDF:Seq></pfs:updates>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{949a51e0-c633-4d9e-bf3a-6e0c2bc6e508}:">
<pfs:name>Test plugin 2</pfs:name>
<pfs:requestedMimetype>application/x-broken-installer</pfs:requestedMimetype>
<pfs:guid>{949a51e0-c633-4d9e-bf3a-6e0c2bc6e508}</pfs:guid>
<pfs:version/>
<pfs:IconUrl/>
<pfs:InstallerLocation>http://example.com/browser/toolkit/mozapps/plugins/tests/BadPlugin</pfs:InstallerLocation>
<pfs:InstallerHash/>
<pfs:InstallerShowsUI>false</pfs:InstallerShowsUI>
<pfs:manualInstallationURL>http://www.mozilla.com</pfs:manualInstallationURL>
<pfs:licenseURL/>
<pfs:needsRestart>false</pfs:needsRestart>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin-results:application/x-broken-plugin-hash">
<pfs:plugins><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{cf1765cc-f962-4680-8a4d-2ba13971a24f}"/>
</RDF:Seq></pfs:plugins>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{cf1765cc-f962-4680-8a4d-2ba13971a24f}">
<pfs:updates><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{cf1765cc-f962-4680-8a4d-2ba13971a24f}:"/>
</RDF:Seq></pfs:updates>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{cf1765cc-f962-4680-8a4d-2ba13971a24f}:">
<pfs:name>Test plugin 3</pfs:name>
<pfs:requestedMimetype>application/x-broken-plugin-hash</pfs:requestedMimetype>
<pfs:guid>{8d3ab839-e03e-41a5-acd3-be1eabf94810}</pfs:guid>
<pfs:version/>
<pfs:IconUrl/>
<pfs:InstallerLocation>http://example.com/browser/toolkit/mozapps/plugins/tests/GoodPlugin</pfs:InstallerLocation>
<pfs:InstallerHash>sha1:foo</pfs:InstallerHash>
<pfs:InstallerShowsUI>false</pfs:InstallerShowsUI>
<pfs:manualInstallationURL>http://www.mozilla.com</pfs:manualInstallationURL>
<pfs:licenseURL/>
<pfs:needsRestart>false</pfs:needsRestart>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin-results:application/x-working-extension">
<pfs:plugins><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{2fdd6830-66fe-43e7-8ef6-ce49998c8926}"/>
</RDF:Seq></pfs:plugins>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{2fdd6830-66fe-43e7-8ef6-ce49998c8926}">
<pfs:updates><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{2fdd6830-66fe-43e7-8ef6-ce49998c8926}:"/>
</RDF:Seq></pfs:updates>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{2fdd6830-66fe-43e7-8ef6-ce49998c8926}:">
<pfs:name>Test extension 1</pfs:name>
<pfs:requestedMimetype>application/x-working-extension</pfs:requestedMimetype>
<pfs:guid>{2fdd6830-66fe-43e7-8ef6-ce49998c8926}</pfs:guid>
<pfs:version/>
<pfs:IconUrl/>
<pfs:XPILocation>http://example.com/browser/toolkit/mozapps/plugins/tests/GoodExtension.xpi</pfs:XPILocation>
<pfs:XPIHash>sha1:ccda7915ba891cc6fd9d0874b8042be2ecaa2d65</pfs:XPIHash>
<pfs:InstallerShowsUI>false</pfs:InstallerShowsUI>
<pfs:manualInstallationURL>http://www.mozilla.com</pfs:manualInstallationURL>
<pfs:licenseURL/>
<pfs:needsRestart>false</pfs:needsRestart>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin-results:application/x-broken-extension">
<pfs:plugins><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{91fdf294-3a51-48c6-b5e8-423b0eb4e84e}"/>
</RDF:Seq></pfs:plugins>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{91fdf294-3a51-48c6-b5e8-423b0eb4e84e}">
<pfs:updates><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{91fdf294-3a51-48c6-b5e8-423b0eb4e84e}:"/>
</RDF:Seq></pfs:updates>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{91fdf294-3a51-48c6-b5e8-423b0eb4e84e}:">
<pfs:name>Test extension 2</pfs:name>
<pfs:requestedMimetype>application/x-broken-extension</pfs:requestedMimetype>
<pfs:guid>{91fdf294-3a51-48c6-b5e8-423b0eb4e84e}</pfs:guid>
<pfs:version/>
<pfs:IconUrl/>
<pfs:XPILocation>http://example.com/browser/toolkit/mozapps/plugins/tests/BadExtension.xpi</pfs:XPILocation>
<pfs:XPIHash/>
<pfs:InstallerShowsUI>false</pfs:InstallerShowsUI>
<pfs:manualInstallationURL>http://www.mozilla.com</pfs:manualInstallationURL>
<pfs:licenseURL/>
<pfs:needsRestart>false</pfs:needsRestart>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin-results:application/x-broken-extension-hash">
<pfs:plugins><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{889d0f32-4c77-4a57-8be1-44d109a210e4}"/>
</RDF:Seq></pfs:plugins>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{889d0f32-4c77-4a57-8be1-44d109a210e4}">
<pfs:updates><RDF:Seq>
<RDF:li resource="urn:mozilla:plugin:{889d0f32-4c77-4a57-8be1-44d109a210e4}:"/>
</RDF:Seq></pfs:updates>
</RDF:Description>
<RDF:Description about="urn:mozilla:plugin:{889d0f32-4c77-4a57-8be1-44d109a210e4}:">
<pfs:name>Test extension 3</pfs:name>
<pfs:requestedMimetype>application/x-broken-extension-hash</pfs:requestedMimetype>
<pfs:guid>{889d0f32-4c77-4a57-8be1-44d109a210e4}</pfs:guid>
<pfs:version/>
<pfs:IconUrl/>
<pfs:XPILocation>http://example.com/browser/toolkit/mozapps/plugins/tests/GoodExtension.xpi</pfs:XPILocation>
<pfs:XPIHash>sha1:3504e7bd87bad1246b7a016b29bdb50fe41dbc83</pfs:XPIHash>
<pfs:InstallerShowsUI>false</pfs:InstallerShowsUI>
<pfs:manualInstallationURL>http://www.mozilla.com</pfs:manualInstallationURL>
<pfs:licenseURL/>
<pfs:needsRestart>false</pfs:needsRestart>
</RDF:Description>
</RDF:RDF>

Просмотреть файл

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pfs="http://www.mozilla.org/2004/pfs-rdf#">
</RDF>

Просмотреть файл

@ -79,7 +79,6 @@ toolkit.jar:
skin/classic/mozapps/plugins/pluginBlocked-64.png (plugins/pluginBlocked-64.png)
skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png)
skin/classic/mozapps/plugins/pluginHelp-16.png (plugins/pluginHelp-16.png)
skin/classic/mozapps/plugins/pluginInstallerWizard.css (plugins/pluginInstallerWizard.css)
skin/classic/mozapps/profile/profileicon.png (profile/profileicon.png)
skin/classic/mozapps/profile/profileSelection.css (profile/profileSelection.css)
skin/classic/mozapps/update/downloadButtons.png (update/downloadButtons.png)
@ -163,7 +162,6 @@ toolkit.jar:
skin/classic/aero/mozapps/plugins/pluginBlocked-64.png (plugins/pluginBlocked-64.png)
skin/classic/aero/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16-aero.png)
skin/classic/aero/mozapps/plugins/pluginHelp-16.png (plugins/pluginHelp-16.png)
skin/classic/aero/mozapps/plugins/pluginInstallerWizard.css (plugins/pluginInstallerWizard.css)
skin/classic/aero/mozapps/profile/profileicon.png (profile/profileicon-aero.png)
skin/classic/aero/mozapps/profile/profileSelection.css (profile/profileSelection.css)
skin/classic/aero/mozapps/update/downloadButtons.png (update/downloadButtons-aero.png)