296868 - Land Software Update Service on the trunk. Part of ongoing 1.1 feature work. Contains work by Darin Fisher and myself. This feature does not function yet but should not be intrusive. Includes first phase of 296566 - move extension update into the Extension Manager (r=darin)

This commit is contained in:
ben%bengoodger.com 2005-06-06 21:07:13 +00:00
parent cb977fa5f8
commit f0897b87c8
37 changed files with 3207 additions and 2875 deletions

View File

@ -68,38 +68,41 @@
label="&helpMenu.label;"
accesskey="&helpMenu.accesskey;">
#endif
<menupopup id="menu_HelpPopup">
<menuitem oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
<menupopup id="menu_HelpPopup">
<menuitem oncommand="openHelp('firefox-help', 'chrome://browser/locale/help/help.rdf');"
#ifdef XP_MACOSX
label="&helpContentsMac.label;"
key="key_openHelpMacFrontend"/>
label="&helpContentsMac.label;"
key="key_openHelpMacFrontend"/>
#else
label="&helpContents.label;"
accesskey="&helpContents.accesskey;"
key="key_openHelp"/>
label="&helpContents.label;"
accesskey="&helpContents.accesskey;"
key="key_openHelp"/>
#endif
# Show IE Users menu item on Windows only
#ifdef XP_WIN
<menuitem label="&helpForIEUsers.label;"
accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelp('ieusers', 'chrome://browser/locale/help/help.rdf');"/>
<menuitem label="&helpForIEUsers.label;"
accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelp('ieusers', 'chrome://browser/locale/help/help.rdf');"/>
#endif
<menuseparator/>
<menuitem accesskey="&promote.accesskey;"
label="&promote.label;"
oncommand="openUILink(getUILink('promote'), event, false, true);"
onclick="checkForMiddleClick(this, event);"/>
<menuitem accesskey="&helpReleaseNotes.accesskey;"
label="&helpReleaseNotes.label;"
oncommand="openReleaseNotes(event)"
onclick="checkForMiddleClick(this, event);"/>
#ifndef XP_MACOSX
<menuseparator id="aboutSeparator"/>
<menuseparator id="aboutSeparator"/>
#endif
<menuitem id="aboutName"
accesskey="&aboutCmd.accesskey;"
label="&aboutCmd.label;"
<menuitem id="checkForUpdates"
accesskey="&updateCmd.accesskey;"
label="&updateCmd.label;"
oncommand="checkForUpdates();"/>
<menuitem id="aboutName"
accesskey="&aboutCmd.accesskey;"
label="&aboutCmd.label;"
#ifdef XP_MACOSX
hidden="true"
hidden="true"
#endif
oncommand="openAboutDialog();"/>
</menupopup>
oncommand="openAboutDialog();"/>
</menupopup>
</menu>
<keyset id="baseMenuKeyset">

View File

@ -8,10 +8,6 @@ toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar");
}
toolbarbutton[type="updates"] {
-moz-binding: url("chrome://mozapps/content/update/updates.xml#updateStatusbarNotification");
}
#noPreviewAvailable
{
background-color: white !important;

View File

@ -5785,11 +5785,3 @@ missingPluginInstaller.prototype.observe = function(aSubject, aTopic, aData){
}
var gMissingPluginInstaller = new missingPluginInstaller();
function checkForUpdates() {
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates([], 0, Components.interfaces.nsIUpdateItem.TYPE_ANY,
Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
window);
}

View File

@ -425,12 +425,28 @@ function openPreferences(paneID)
"Preferences", features, paneID);
}
function getUILink(item)
/**
* Opens the release notes page for this version of the application.
* @param event
* The DOM Event that caused this function to be called, used to
* determine where the release notes page should be displayed based
* on modifiers (e.g. Ctrl = new tab)
*/
function openReleaseNotes(event)
{
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
var regionBundle = document.getElementById("bundle_browser_region");
if (item == "promote")
return regionBundle.getString("promoteURL");
return "";
var relnotesURL = regionBundle.getFormattedString("releaseNotesURL", [appInfo.version]);
openUILink(relnotesURL, event, false, true);
}
/**
* Opens the update manager and checks for updates to the application.
*/
function checkForUpdates()
{
var prompter = Components.classes["@mozilla.org/updates/update-prompt;1"]
.createInstance(Components.interfaces.nsIUpdatePrompt);
prompter.checkForUpdates();
}

View File

@ -3,7 +3,7 @@ general.useragent.contentlocale=US
homePageDefault=http://start.mozilla.org/firefox
fallbackDefaultSearchURL=http://www.google.com/search?&q=
promoteURL=http://www.spreadfirefox.com/promote/
releaseNotesURL=http://www.mozilla.org/products/firefox/releases/%S.html
# firefox.js
browser.startup.homepage=http://start.mozilla.org/firefox

View File

@ -27,5 +27,8 @@
<!ENTITY openHelpMac2.frontendCommandkey "?">
<!ENTITY openHelpMac2.frontendModifiers "accel">
<!ENTITY promote.label "Promote &brandShortName;">
<!ENTITY promote.accesskey "P">
<!ENTITY helpReleaseNotes.accesskey "R">
<!ENTITY helpReleaseNotes.label "Release Notes">
<!ENTITY updateCmd.accesskey "U">
<!ENTITY updateCmd.label "Check for Updates...">

View File

@ -347,9 +347,6 @@
<!ENTITY editPopupSettings.accesskey "E">
<!ENTITY dontShowMessage.accesskey "D">
<!ENTITY promote.label "Promote &brandShortName;">
<!ENTITY promote.accesskey "P">
<!ENTITY bidiSwitchPageDirectionItem.label "Switch Page Direction">
<!ENTITY bidiSwitchPageDirectionItem.accesskey "g">
<!ENTITY bidiSwitchTextDirectionItem.label "Switch Text Direction">

View File

@ -366,9 +366,10 @@ Contributors:
<p>Opens this Help window displaying information that can
help Internet Explorer users transition to &brandShortName;.</p>
<h3 id="promote">Promote &brandShortName;</h3>
<p>Opens a web page that gives you information on how to promote
&brandShortName;.</p>
<h3 id="relnotes">Release Notes</h3>
<p>Provides information about installing, uninstalling and configuring &brandShortName;,
as well as other important information and late breaking notices. Requires an
active Internet connection.</p>
<h3 id="about_mozilla_firebird">About &brandFullName;</h3>
<p>Displays a dialog box with information about &brandShortName;, including

View File

@ -40,6 +40,8 @@
<!ENTITY cmd.moveUp.accesskey "p">
<!ENTITY cmd.moveDn.label "Move Down">
<!ENTITY cmd.moveDn.accesskey "w">
<!ENTITY cmd.showFolder.label "Show Item Contents...">
<!ENTITY cmd.showFolder.accesskey "C">
<!-- Extension Items -->
<!ENTITY options.tooltip "Options">

View File

@ -1,5 +1,87 @@
<!ENTITY update.title "Checking for Updates">
<!ENTITY intro.label "&brandShortName; is now checking for updates to your extensions...">
<!ENTITY updateWizard.title "&brandShortName; Update">
<!ENTITY mismatch.title "Incompatible Components">
<!ENTITY mismatch.intro1.label "The following components are not compatible with the new version
of &brandShortName; you have just installed:">
<!ENTITY mismatch.intro2.label "They have been disabled until compatible versions are
installed.">
<!ENTITY mismatch.intro3.label "&brandShortName; can check for and install newer, compatible
versions of these components.">
<!ENTITY checking.title "Checking for Updates">
<!ENTITY checking.intro.label "&brandShortName; is now checking for available updates...">
<!ENTITY checking.status "This may take a few minutes...">
<!ENTITY version.title "Checking for Compatibility Updates">
<!ENTITY version.intro.label "&brandShortName; is now checking for compatibility updates to your Extensions and Themes...">
<!ENTITY version.status "This may take a few minutes...">
<!ENTITY found.title "Updates Found">
<!ENTITY found.intro.label "&brandShortName; found the following available updates:">
<!ENTITY from.label "from: ">
<!ENTITY found.updatetype.patches.accesskey "C">
<!ENTITY found.updatetype.components.accesskey "O">
<!ENTITY found.updatetype.addons.accesskey "E">
<!ENTITY found.updatetype.languages.accesskey "L">
<!ENTITY found.criticalUpdates.label "The following Critical Updates are available for &brandShortName;:">
<!ENTITY found.criticalUpdates.info "You should install these updates immediately to protect your computer from attack.">
<!ENTITY found.app.infoLink "More Information...">
<!ENTITY found.components.label "The following components and plugins are available to install:">
<!ENTITY found.components.info "Installing these components may improve your browsing experience.">
<!ENTITY found.addons.label "The following updates are available to Extensions and Themes that you already have installed">
<!ENTITY found.languages.label "The following language packs are available: ">
<!ENTITY installing.title "Installing Updates">
<!ENTITY installing.intro.label "Now downloading and installing updates...">
<!ENTITY installing.disclaimer.label "XXXben - this will not work until we have a scriptable API to XPInstall.">
<!ENTITY noupdates.title "No Updates Found">
<!ENTITY noupdates.intro.user.label "&brandShortName; was not able to find any available updates.">
<!ENTITY noupdates.intro.mismatch.label "&brandShortName; was not able to find any available updates -
compatible versions may not be available at this time.">
<!ENTITY noupdates.intro2.mismatch.label "&brandShortName; will check periodically and inform you when
compatible versions become available.">
<!ENTITY noupdates.intro3.mismatch.label "&brandShortName; can check periodically and inform you when
compatible versions become available.">
<!ENTITY noupdates.enableChecking.label "Allow &brandShortName; to check for updates.">
<!ENTITY finished.title "Update Complete">
<!ENTITY finished.updated.label "&brandShortName; has installed the available updates. You will have to restart &brandShortName; for some updates to take effect.">
<!ENTITY finished.remaining.label "Some incompatible components could not be updated, perhaps
because compatible versions are not available at this time.
&brandShortName; will check periodically and inform you
when updated versions become available.">
<!ENTITY finished.remaining2.label "Some incompatible components could not be updated, perhaps
because compatible versions are not available at this time.
&brandShortName; can check periodically and inform you
when updated versions become available.">
<!ENTITY finished.error.label "&brandShortName; did not succeed in downloading and
installing some updates.">
<!ENTITY finished.enableChecking.label "Allow &brandShortName; to check for updates.">
<!ENTITY finished.mismatch.label "Click Finish to continue starting &brandShortName;.">
<!ENTITY optional.title "Optional Components">
<!ENTITY optional.intro.label "Choose additional components you want to install, then click Install Now.">
<!ENTITY errors.title "Problems During Update">
<!ENTITY errors.intro.label "&brandShortName; encountered problems when updating your
software, and as a result not all components could be updated.">
<!ENTITY errors.details.label "Details">
<!ENTITY errors.details.accesskey "D">
<!ENTITY updateCheckError.description "&brandShortName; encountered problems when trying to find
updates for some items.">
<!ENTITY updateCheckError.label "Details">
<!ENTITY updateCheckError.accesskey "D">
<!ENTITY resolveMaxVersion.title "Checking for Compatible Extensions and Themes...">
<!ENTITY resolveMaxVersion.intro1.label "&brandShortName; is checking for compatibility updates to your Extensions and Themes...">
<!ENTITY restart.title "Upgrade Complete">
<!ENTITY restart.updated.label "&brandShortName; successfully downloaded and installed updates. You will have to restart &brandShortName; to complete the update.">
<!ENTITY resetHomepage.label "Use &brandShortName; Start as my Home Page">
<!ENTITY resetHomepage.accesskey "H">

View File

@ -0,0 +1,52 @@
mismatchCheckNow=Check Now
mismatchCheckNowAccesskey=C
mismatchDontCheck=Don't Check
mismatchDontCheckAccesskey=D
installButtonText=Install Now
installButtonTextAccesskey=I
nextButtonText=Next >
nextButtonTextAccesskey=N
cancelButtonText=Cancel
cancelButtonTextAccesskey=C
app.update.url=https://aus.mozilla.org/update/firefox/en-US.rdf
updatesAvailableTitle=New Updates Available
updatesAvailableText=Click Here to View
checkingPrefix=Checking for Updates to %S ...
downloadingPrefix=Downloading: %S
installingPrefix=Installing: %S
closeButton=Close
installErrorDescription=The following components could not be installed due to errors (the file could not be downloaded, was corrupt, or for some other reason).
checkingErrorDescription=%S could not check for updates to the following components (either the update server(s) did not respond, or the update service(s) were not found).
installErrorItemFormat=%S (%S)
versionUpdateComplete=Version Compatibility Update Complete
updatesAvailableTooltip-0=Update(s) Available
updatesAvailableTooltip-1=Update(s) Available
updatesAvailableTooltip-2=Critical Update(s) Available
updatesCheckForUpdatesTooltip=Double-click here to check for updates
installTextNoFurtherActions=Choose the ones you want to install and click Install Now to install them.
installTextFurtherCations=Choose the ones you want to install and click Next to continue.
appNameAndVersionFormat=%S %S
updateTypePatches=Critical Updates (%S)
updateTypeComponents=Optional Components (%S)
updateTypeExtensions=Extensions and Themes (%S)
updateTypeLangPacks=Language Packs (%S)
foundAppLabel=%S %S is available. We strongly recommend that you install this upgrade as soon as possible.
foundAppFeatures=%S %S features:
foundAppInfoLink=More information about %S %S ...
foundInstructions=Choose the ones you want to install and click Install Now to install them.
foundInstructionsAppComps=Choose the ones you want to install and click Next to continue.
appupdateperformedtitle=Restart Required
appupdateperformedmessage=%S has been updated this session. Please restart %S before performing any more updates.
updatesdisabledtitle=Update Disabled
updatesdisabledmessage=Update has been disabled by your Administrator.

View File

@ -0,0 +1,14 @@
<!ENTITY incompatible.title "Incompatible Items">
<!ENTITY incompatible.intro "The following items are not compatible with this update to &brandShortName; and
will be disabled when it is installed:">
<!ENTITY incompatible.update "&brandShortName; will periodically check for updates to them in the event that
a compatible version becomes available.">
<!ENTITY incompatible.suffix "&brandShortName; updates contain important security improvements. It is highly
recommended that you update &brandShortName; even if some of your Extensions
and Themes become incompatible, to ensure maximum protection when browsing the
Web.">
<!ENTITY closebutton.label "Close">

View File

@ -1,83 +0,0 @@
<!ENTITY updateWizard.title "&brandShortName; Update">
<!ENTITY mismatch.title "Incompatible Components">
<!ENTITY mismatch.intro1.label "The following components are not compatible with the new version
of &brandShortName; you have just installed:">
<!ENTITY mismatch.intro2.label "They have been disabled until compatible versions are
installed.">
<!ENTITY mismatch.intro3.label "&brandShortName; can check for and install newer, compatible
versions of these components.">
<!ENTITY checking.title "Checking for Updates">
<!ENTITY checking.intro.label "&brandShortName; is now checking for available updates...">
<!ENTITY checking.status "This may take a few minutes...">
<!ENTITY version.title "Checking for Compatibility Updates">
<!ENTITY version.intro.label "&brandShortName; is now checking for compatibility updates to your Extensions and Themes...">
<!ENTITY version.status "This may take a few minutes...">
<!ENTITY found.title "Updates Found">
<!ENTITY found.intro.label "&brandShortName; found the following available updates:">
<!ENTITY from.label "from: ">
<!ENTITY found.updatetype.patches.accesskey "C">
<!ENTITY found.updatetype.components.accesskey "O">
<!ENTITY found.updatetype.addons.accesskey "E">
<!ENTITY found.updatetype.languages.accesskey "L">
<!ENTITY found.criticalUpdates.label "The following Critical Updates are available for &brandShortName;:">
<!ENTITY found.criticalUpdates.info "You should install these updates immediately to protect your computer from attack.">
<!ENTITY found.app.infoLink "More Information...">
<!ENTITY found.components.label "The following components and plugins are available to install:">
<!ENTITY found.components.info "Installing these components may improve your browsing experience.">
<!ENTITY found.addons.label "The following updates are available to Extensions and Themes that you already have installed">
<!ENTITY found.languages.label "The following language packs are available: ">
<!ENTITY installing.title "Installing Updates">
<!ENTITY installing.intro.label "Now downloading and installing updates...">
<!ENTITY installing.disclaimer.label "XXXben - this will not work until we have a scriptable API to XPInstall.">
<!ENTITY noupdates.title "No Updates Found">
<!ENTITY noupdates.intro.user.label "&brandShortName; was not able to find any available updates.">
<!ENTITY noupdates.intro.mismatch.label "&brandShortName; was not able to find any available updates -
compatible versions may not be available at this time.">
<!ENTITY noupdates.intro2.mismatch.label "&brandShortName; will check periodically and inform you when
compatible versions become available.">
<!ENTITY noupdates.intro3.mismatch.label "&brandShortName; can check periodically and inform you when
compatible versions become available.">
<!ENTITY noupdates.enableChecking.label "Allow &brandShortName; to check for updates.">
<!ENTITY finished.title "Update Complete">
<!ENTITY finished.updated.label "&brandShortName; has installed the available updates. You will have to restart &brandShortName; for some updates to take effect.">
<!ENTITY finished.remaining.label "Some incompatible components could not be updated, perhaps
because compatible versions are not available at this time.
&brandShortName; will check periodically and inform you
when updated versions become available.">
<!ENTITY finished.remaining2.label "Some incompatible components could not be updated, perhaps
because compatible versions are not available at this time.
&brandShortName; can check periodically and inform you
when updated versions become available.">
<!ENTITY finished.error.label "&brandShortName; did not succeed in downloading and
installing some updates.">
<!ENTITY finished.enableChecking.label "Allow &brandShortName; to check for updates.">
<!ENTITY finished.mismatch.label "Click Finish to continue starting &brandShortName;.">
<!ENTITY optional.title "Optional Components">
<!ENTITY optional.intro.label "Choose additional components you want to install, then click Install Now.">
<!ENTITY errors.title "Problems During Update">
<!ENTITY errors.intro.label "&brandShortName; encountered problems when updating your
software, and as a result not all components could be updated.">
<!ENTITY errors.details.label "Details">
<!ENTITY errors.details.accesskey "D">
<!ENTITY updateCheckError.description "&brandShortName; encountered problems when trying to find
updates for some items.">
<!ENTITY updateCheckError.label "Details">
<!ENTITY updateCheckError.accesskey "D">
<!ENTITY resolveMaxVersion.title "Checking for Compatible Extensions and Themes...">
<!ENTITY resolveMaxVersion.intro1.label "&brandShortName; is checking for compatibility updates to your Extensions and Themes...">
<!ENTITY restart.title "Upgrade Complete">
<!ENTITY restart.updated.label "&brandShortName; successfully downloaded and installed updates. You will have to restart &brandShortName; to complete the update.">

View File

@ -0,0 +1,38 @@
<!ENTITY updateWizard.title "Software Update">
<!ENTITY checking.title "Checking for Updates">
<!ENTITY checking.label "&brandShortName; is now checking for updates...">
<!ENTITY cancel.label "Cancel">
<!ENTITY cancel.accesskey "C">
<!ENTITY updatesfound.title "Updates Available">
<!ENTITY forMoreInfo.label "For more information, ">
<!ENTITY clickHere.label "Click Here">
<!ENTITY updateAvailable.placeholder "This is a line of text that should wrap comfortably to two
lines in the current language.">
<!ENTITY incompatible.warning "This update will cause some of your extensions and/or themes
to stop working until they are updated.">
<!ENTITY listIncompatible.label "Show List">
<!ENTITY listIncompatible.accesskey "L">
<!ENTITY later.label "Later">
<!ENTITY later.accesskey "a">
<!ENTITY download.label "Download &amp; Install &#0187;">
<!ENTITY download.accesskey "D">
<!ENTITY upgrade.evangelism "It is strongly recommended that you upgrade &brandShortName;
as soon as possible by clicking Download &amp; Install &#0187;.">
<!ENTITY downloading.intro "The following updates are being/have been installed:">
<!ENTITY showCompletedUpdates.label "Show old updates in this list">
<!ENTITY showCompletedUpdates.accesskey "o">
<!ENTITY details.link "Details">
<!ENTITY pause.label "Pause">
<!ENTITY pause.accesskey "P">
<!ENTITY close.label "Close">
<!ENTITY close.accesskey "C">

View File

@ -0,0 +1,5 @@
updateName=%S %S
updateType_major=New Version
updateType_minor=Security Update
introType_minor=An important Security Update for %S is available:
introType_major=A new version of %S is available:

View File

@ -76,6 +76,8 @@
locale/@AB_CD@/mozapps/extensions/extensions.properties (%chrome/mozapps/extensions/extensions.properties)
locale/@AB_CD@/mozapps/extensions/about.dtd (%chrome/mozapps/extensions/about.dtd)
locale/@AB_CD@/mozapps/extensions/finalize.dtd (%chrome/mozapps/extensions/finalize.dtd)
locale/@AB_CD@/mozapps/extensions/update.dtd (%chrome/mozapps/extensions/update.dtd)
locale/@AB_CD@/mozapps/extensions/update.properties (%chrome/mozapps/extensions/update.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/ocsp.dtd (%chrome/mozapps/preferences/ocsp.dtd)
@ -86,8 +88,9 @@
locale/@AB_CD@/mozapps/profile/createProfileWizard.dtd (%chrome/mozapps/profile/createProfileWizard.dtd)
locale/@AB_CD@/mozapps/profile/profileSelection.properties (%chrome/mozapps/profile/profileSelection.properties)
locale/@AB_CD@/mozapps/profile/profileSelection.dtd (%chrome/mozapps/profile/profileSelection.dtd)
locale/@AB_CD@/mozapps/update/update.dtd (%chrome/mozapps/update/update.dtd)
locale/@AB_CD@/mozapps/update/update.properties (%chrome/mozapps/update/update.properties)
locale/@AB_CD@/mozapps/update/updates.dtd (%chrome/mozapps/update/updates.dtd)
locale/@AB_CD@/mozapps/update/updates.properties (%chrome/mozapps/update/updates.properties)
locale/@AB_CD@/mozapps/update/incompatible.dtd (%chrome/mozapps/update/incompatible.dtd)
locale/@AB_CD@/mozapps/update/errors.dtd (%chrome/mozapps/update/errors.dtd)
locale/@AB_CD@/mozapps/xpinstall/xpinstallConfirm.dtd (%chrome/mozapps/xpinstall/xpinstallConfirm.dtd)
locale/@AB_CD@/mozapps/xpinstall/xpinstallConfirm.properties (%chrome/mozapps/xpinstall/xpinstallConfirm.properties)

View File

@ -69,6 +69,8 @@ const OP_NEEDS_UNINSTALL = "needs-uninstall";
const OP_NEEDS_ENABLE = "needs-enable";
const OP_NEEDS_DISABLE = "needs-disable";
const URI_EXTENSION_UPDATE_DIALOG = "chrome://mozapps/content/extensions/update.xul";
///////////////////////////////////////////////////////////////////////////////
// Utility Functions
@ -517,10 +519,11 @@ function onThemeSelect(aEvent)
var gExtensionContextMenus = ["menuitem_options", "menuitem_homepage", "menuitem_about",
"menuseparator_1", "menuitem_uninstall", "menuitem_update",
"menuitem_enable", "menuitem_disable", "menuseparator_2",
"menuitem_moveTop", "menuitem_moveUp", "menuitem_moveDn"];
"menuitem_moveTop", "menuitem_moveUp", "menuitem_moveDn",
"menuseparator_3", "menuitem_showFolder"];
var gThemeContextMenus = ["menuitem_useTheme", "menuitem_homepage", "menuitem_about",
"menuseparator_1", "menuitem_uninstall", "menuitem_update",
"menuitem_enable"];
"menuitem_enable", "menuseparator_3", "menuitem_showFolder"];
function buildContextMenu(aEvent)
{
@ -761,6 +764,9 @@ var gExtensionsViewController = {
case "cmd_movedn":
var children = gExtensionsView.children;
return selectedItem && (children[children.length-1] != selectedItem);
case "cmd_showFolder":
return selectedItem &&
selectedItem.getAttribute("toBeInstalled") != "true";
#ifndef MOZ_PHOENIX
case "cmd_install":
return true;
@ -884,11 +890,26 @@ var gExtensionsViewController = {
var id = aSelectedItem ? getIDFromResourceURI(aSelectedItem.id) : null;
var itemType = gWindowState == "extensions" ? nsIUpdateItem.TYPE_EXTENSION : nsIUpdateItem.TYPE_THEME;
var items = id ? [gExtensionManager.getItemForID(id)] : [];
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates(items, items.length, itemType,
Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
window);
var ary = Components.classes["@mozilla.org/supports-array;1"]
.createInstance(Components.interfaces.nsISupportsArray);
var updateTypes = Components.classes["@mozilla.org/supports-PRUint8;1"]
.createInstance(Components.interfaces.nsISupportsPRUint8);
updateTypes.data = itemType;
ary.AppendElement(updateTypes);
var sourceEvent = Components.classes["@mozilla.org/supports-PRBool;1"]
.createInstance(Components.interfaces.nsISupportsPRBool);
sourceEvent.data = false;
ary.AppendElement(sourceEvent);
for (var i = 0; i < items.length; ++i)
ary.AppendElement(items[i]);
var features = "chrome,centerscreen,dialog,titlebar";
// This *must* be modal so as not to break startup! This code is invoked before
// the main event loop is initiated (via checkForMismatches).
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
ww.openWindow(window, URI_EXTENSION_UPDATE_DIALOG, "", features, ary);
},
cmd_uninstall: function (aSelectedItem)
@ -931,6 +952,15 @@ var gExtensionsViewController = {
gExtensionsView.selected = document.getElementById(nextElement);
},
cmd_showFolder: function (aSelectedItem)
{
var id = getIDFromResourceURI(aSelectedItem.id);
var installLocation = gExtensionManager.getInstallLocation(id);
var location = installLocation.getItemLocation(id);
if (location instanceof Components.interfaces.nsILocalFile)
location.reveal();
},
cmd_disable: function (aSelectedItem)
{
gExtensionManager.disableItem(getIDFromResourceURI(aSelectedItem.id));

View File

@ -100,6 +100,7 @@
<command id="cmd_moveup"/>
<command id="cmd_movedn"/>
<command id="cmd_useTheme"/>
<command id="cmd_showFolder"/>
</commandset>
<vbox id="contextMenuPalette" hidden="true">
@ -131,6 +132,9 @@
label="&cmd.moveUp.label;" accesskey="&cmd.moveUp.accesskey;"/>
<menuitem id="menuitem_moveDn" command="cmd_movedn"
label="&cmd.moveDn.label;" accesskey="&cmd.moveDn.accesskey;"/>
<menuseparator id="menuseparator_3"/>
<menuitem id="menuitem_showFolder" command="cmd_showFolder"
label="&cmd.showFolder.label;" accesskey="&cmd.showFolder.accesskey;"/>
</vbox>
<popup id="extensionContextMenu" onpopupshowing="return buildContextMenu(event);"/>

View File

@ -0,0 +1,41 @@
radiogroup[type="update-types"] {
overflow: auto;
-moz-binding: url("chrome://mozapps/content/extensions/update.xml#updateCategorySet");
}
radio[type="update-type"] {
-moz-binding: url("chrome://mozapps/content/extensions/update.xml#updateCategory");
-moz-box-orient: vertical;
-moz-box-align: stretch;
}
radio[type="update-type"] .updateCategoryContent {
visibility: collapse;
}
radiogroup[_uninitialized] radio[type="update-type"] .updateCategoryContent {
visibility: visible !important;
}
.updateCategoryContent {
overflow: hidden;
}
radio[type="update-type"][selected="true"] .updateCategoryContent {
visibility: visible;
}
.wizard-header-description {
display: none;
}
checkbox[type="update"] {
-moz-binding: url("chrome://mozapps/content/extensions/update.xml#updateItem");
}
link {
-moz-binding: url("chrome://mozapps/content/extensions/update.xml#link");
-moz-user-focus: normal;
}

View File

@ -12,7 +12,7 @@
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is The Extension Manager.
# The Original Code is The Update Service.
#
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2004
@ -35,111 +35,558 @@
#
# ***** END LICENSE BLOCK *****
var gUpdateDialog = {
_updateType: "",
_extensionManager: "",
_extensionID: "",
_openTime: null,
_brandShortName: "",
_updateStrings: null,
_extensionsToUpdate: [],
//
// window.arguments[1...] is an array of nsIUpdateItem implementing objects
// that are to be updated.
// * if the array is empty, all items are updated (like a background update
// check)
// * if the array contains one or two UpdateItems, with null id fields,
// all items of that /type/ are updated.
//
// This UI can be opened from the following places, and in the following modes:
//
// - from the Version Compatibility Checker at startup
// as the application starts a check is done to see if the application being
// started is the same version that was started last time. If it isn't, a
// list of UpdateItems that are incompatible with the verison being
// started is generated and this UI opened with that list. This UI then
// offers to check for updates to those UpdateItems that are compatible
// with the version of the application being started.
//
// In this mode, the wizard is opened to panel 'mismatch'.
//
// - from the Extension Manager or Options Dialog or any UI where the user
// directly requests to check for updates.
// in this case the user selects UpdateItem(s) to update and this list
// is passed to this UI. If a single item is sent with the id field set to
// null but the type set correctly, this UI will check for updates to all
// items of that type.
//
// In this mode, the wizard is opened to panel 'checking'.
//
const nsIUpdateItem = Components.interfaces.nsIUpdateItem;
const nsIUpdateService = Components.interfaces.nsIUpdateService;
const PREF_UPDATE_EXTENSIONS_AUTOUPDATEENABLED = "extensions.update.autoUpdateEnabled";
const PREF_UPDATE_EXTENSIONS_COUNT = "extensions.update.count";
const PREF_UPDATE_EXTENSIONS_SEVERITY_THRESHOLD = "extensions.update.severity.threshold";
const PREF_UPDATE_SEVERITY = "update.severity";
var gShowMismatch = null;
var gUpdateTypes = null;
var gUpdateWizard = {
// The items to check for updates for (e.g. an extension, some subset of extensions,
// all extensions, a list of compatible extensions, etc...)
items: [],
// The items that we found updates available for
itemsToUpdate: [],
// The items that we successfully installed updates for
updatedCount: 0,
shouldSuggestAutoChecking: false,
shouldAutoCheck: false,
_messages: ["update-started",
"update-ended",
"update-item-started",
"update-item-ended",
"update-item-error"],
remainingExtensionUpdateCount: 0,
succeeded: true,
init: function ()
{
this._updateType = window.arguments[0];
this._extensionManager = window.arguments[1];
this._extensionID = window.arguments[2];
gUpdateTypes = window.arguments[0];
gShowMismatch = window.arguments[1];
var items = window.arguments;
if (window.arguments.length == 2) {
var em = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
items = [0,0].concat(em.getItemList(nsIUpdateItem.TYPE_ADDON, { }));
}
for (var i = 2; i < items.length; ++i)
this.items.push(items[i].QueryInterface(nsIUpdateItem));
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
this.shouldSuggestAutoChecking = gShowMismatch &&
!pref.getBoolPref(PREF_UPDATE_EXTENSIONS_AUTOUPDATEENABLED);
if (gShowMismatch)
gMismatchPage.init();
else
document.documentElement.advance();
},
uninit: function ()
{
// Ensure all observers are unhooked, just in case something goes wrong or the
// user aborts.
gUpdatePage.uninit();
},
onWizardFinish: function ()
{
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
if (this.shouldSuggestAutoChecking)
pref.setBoolPref("update.extensions.enabled", this.shouldAutoCheck);
if (this.succeeded) {
// Downloading and Installed Extension
this.clearExtensionUpdatePrefs();
}
// Send an event to refresh any FE notification components.
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.notifyObservers(null, "Update:Ended", "1");
},
clearExtensionUpdatePrefs: function ()
{
var pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
if (pref.prefHasUserValue(PREF_UPDATE_EXTENSIONS_COUNT))
pref.clearUserPref(PREF_UPDATE_EXTENSIONS_COUNT);
},
_setUpButton: function (aButtonID, aButtonKey, aDisabled)
{
var strings = document.getElementById("updateStrings");
var button = document.documentElement.getButton(aButtonID);
if (aButtonKey) {
button.label = strings.getString(aButtonKey);
try {
button.accesskey = strings.getString(aButtonKey + "Accesskey");
}
catch (e) {
}
}
button.disabled = aDisabled;
},
setButtonLabels: function (aBackButton, aBackButtonIsDisabled,
aNextButton, aNextButtonIsDisabled,
aCancelButton, aCancelButtonIsDisabled)
{
this._setUpButton("back", aBackButton, aBackButtonIsDisabled);
this._setUpButton("next", aNextButton, aNextButtonIsDisabled);
this._setUpButton("cancel", aCancelButton, aCancelButtonIsDisabled);
},
/////////////////////////////////////////////////////////////////////////////
// Update Errors
errorItems: [],
showErrors: function (aState, aErrors)
{
openDialog("chrome://mozapps/content/update/errors.xul", "",
"modal", { state: aState, errors: aErrors });
},
showUpdateCheckErrors: function ()
{
var errors = [];
for (var i = 0; i < this.errorItems.length; ++i)
errors.push({ name: this.errorItems[i].name, error: true,
item: this.errorItems[i] });
this.showErrors("checking", errors);
},
checkForErrors: function (aElementIDToShow)
{
if (this.errorOnGeneric || this.errorItems.length > 0)
document.getElementById(aElementIDToShow).hidden = false;
},
onWizardClose: function (aEvent)
{
if (gInstallingPage._installing) {
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.notifyObservers(null, "xpinstall-progress", "cancel");
return false;
}
return true;
}
};
var gMismatchPage = {
init: function ()
{
var incompatible = document.getElementById("mismatch.incompatible");
for (var i = 0; i < gUpdateWizard.items.length; ++i) {
var item = gUpdateWizard.items[i];
var listitem = document.createElement("listitem");
listitem.setAttribute("label", item.name + " " + item.version);
incompatible.appendChild(listitem);
}
},
onPageShow: function ()
{
gUpdateWizard.setButtonLabels(null, true,
"mismatchCheckNow", false,
"mismatchDontCheck", false);
document.documentElement.getButton("next").focus();
}
};
var gUpdatePage = {
_completeCount: 0,
_messages: ["Update:Extension:Started",
"Update:Extension:Ended",
"Update:Extension:Item-Started",
"Update:Extension:Item-Ended",
"Update:Extension:Item-Error",
"Update:Ended"],
onPageShow: function ()
{
gUpdateWizard.setButtonLabels(null, true,
"nextButtonText", true,
"cancelButtonText", false);
document.documentElement.getButton("next").focus();
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
for (var i = 0; i < this._messages.length; ++i)
os.addObserver(this, this._messages[i], false);
this._openTime = Math.abs(Date.UTC());
this._brandShortName = document.getElementById("brandStrings").getString("brandShortName");
this._updateStrings = document.getElementById("extensionsStrings");
if (this._updateType == "extensions")
this._extensionManager.updateExtension(this._extensionID, window);
else if (gUpdateType == "themes")
this._extensionManager.updateTheme(this._extensionID);
gUpdateWizard.errorItems = [];
var em = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
em.update(gUpdateWizard.items, gUpdateWizard.items.length, false);
},
_destroyed: false,
uninit: function ()
{
if (this._destroyed)
return;
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
for (var i = 0; i < this._messages.length; ++i)
os.removeObserver(this, this._messages[i]);
this._destroyed = true;
},
cancel: function ()
_totalCount: 0,
get totalCount()
{
// This will cause uninit to be called, removing our listener, so the extension manager's
// notifications will go nowhere.
window.close();
},
if (!this._totalCount) {
this._totalCount = gUpdateWizard.items.length;
if (this._totalCount == 0) {
var em = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
var extensionCount = em.getItemList(nsIUpdateItem.TYPE_EXTENSION, {}).length;
var themeCount = em.getItemList(nsIUpdateItem.TYPE_THEME, {}).length;
this._totalCount = extensionCount + themeCount + 1;
}
}
return this._totalCount;
},
observe: function (aSubject, aTopic, aData)
{
var canFinish = false;
dump("*** items = " + gUpdateWizard.items + "\n");
switch (aTopic) {
case "update-started":
case "Update:Extension:Started":
break;
case "update-item-started":
case "Update:Extension:Item-Started":
break;
case "update-item-ended":
this._extensionsToUpdate.push(aSubject);
break;
case "update-ended":
var installObj = { };
for (var i = 0; i < this._extensionsToUpdate.length; ++i) {
var e = this._extensionsToUpdate[i];
installObj[e.name + " " + e.version] = e.xpiURL;
case "Update:Extension:Item-Ended":
if (aSubject) {
var item = aSubject.QueryInterface(Components.interfaces.nsIUpdateItem);
gUpdateWizard.itemsToUpdate.push(item);
var updateStrings = document.getElementById("updateStrings");
var status = document.getElementById("checking.status");
var statusString = updateStrings.getFormattedString("checkingPrefix", [item.name]);
status.setAttribute("value", statusString);
}
if (InstallTrigger.updateEnabled())
InstallTrigger.install(installObj);
++this._completeCount;
document.documentElement.acceptDialog();
break;
/*
case "update-start":
dump("*** update-start: " + aSubject + ", " + aData + "\n");
break;
case "update-item-network-start":
dump("*** update-item-network-start: " + aSubject + ", " + aData + "\n");
break;
case "update-item-network-end":
dump("*** update-item-network-end: " + aSubject + ", " + aData + "\n");
break;
case "update-item-processing-start":
dump("*** update-item-processing-start: " + aSubject + ", " + aData + "\n");
break;
case "update-item-processing-end":
dump("*** update-item-processing-end: " + aSubject + ", " + aData + "\n");
break;
case "update-item-error":
dump("*** update-item-error: " + aSubject + ", " + aData + "\n");
break;
case "update-end":
dump("*** update-end: " + aSubject + ", " + aData + "\n");
// Update the Progress Bar
var progress = document.getElementById("checking.progress");
progress.value = Math.ceil((this._completeCount / this.totalCount) * 100);
// Report Status
// Unhook observers
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
for (var i = 0; i < this._messages.length; ++i)
os.removeObserver(this, this._messages[i]);
break;
*/
case "Update:Extension:Item-Error":
if (aSubject) {
var item = aSubject.QueryInterface(Components.interfaces.nsIUpdateItem);
gUpdateWizard.errorItems.push(item);
}
else {
for (var i = 0; i < gUpdateWizard.items.length; ++i) {
if (!gUpdateWizard.items[i].updateRDF)
gUpdateWizard.errorItems.push(gUpdateWizard.items[i]);
}
}
++this._completeCount;
var progress = document.getElementById("checking.progress");
progress.value = Math.ceil((this._completeCount / this.totalCount) * 100);
break;
case "Update:Extension:Ended":
canFinish = gUpdateWizard.items.length > 0;
dump("*** " + aTopic + "... canFinish = " + canFinish + "\n");
break;
case "Update:Ended":
// If we're doing a general update check, (that is, no specific extensions/themes
// were passed in for us to check for updates to), this notification means both
// extension and app updates have completed.
canFinish = true;
break;
}
if (canFinish) {
gUpdatePage.uninit();
if ((gUpdateTypes & nsIUpdateItem.TYPE_ADDON && gUpdateWizard.itemsToUpdate.length > 0))
document.getElementById("checking").setAttribute("next", "found");
document.documentElement.advance();
}
}
};
var gFoundPage = {
_nonAppItems: [],
_newestInfo: null,
buildAddons: function ()
{
var hasExtensions = false;
var foundAddonsList = document.getElementById("found.addons.list");
var uri = Components.classes["@mozilla.org/network/standard-url;1"]
.createInstance(Components.interfaces.nsIURI);
var itemCount = gUpdateWizard.itemsToUpdate.length;
for (var i = 0; i < itemCount; ++i) {
var item = gUpdateWizard.itemsToUpdate[i];
var checkbox = document.createElement("checkbox");
foundAddonsList.appendChild(checkbox);
checkbox.setAttribute("type", "update");
checkbox.label = item.name + " " + item.version;
checkbox.URL = item.xpiURL;
checkbox.infoURL = "";
checkbox.internalName = "";
uri.spec = item.xpiURL;
checkbox.source = uri.host;
checkbox.checked = true;
hasExtensions = true;
}
if (hasExtensions) {
var addonsHeader = document.getElementById("addons");
var strings = document.getElementById("updateStrings");
addonsHeader.label = strings.getFormattedString("updateTypeExtensions", [itemCount]);
addonsHeader.collapsed = false;
}
},
_initialized: false,
onPageShow: function ()
{
gUpdateWizard.setButtonLabels(null, true,
"installButtonText", false,
null, false);
document.documentElement.getButton("next").focus();
var updates = document.getElementById("found.updates");
if (!this._initialized) {
this._initialized = true;
updates.computeSizes();
if (gUpdateTypes & nsIUpdateItem.TYPE_ADDON)
this.buildAddons();
}
var kids = updates._getRadioChildren();
for (var i = 0; i < kids.length; ++i) {
if (kids[i].collapsed == false) {
updates.selectedIndex = i;
break;
}
}
},
onSelect: function (aEvent)
{
var updates = document.getElementById("found.updates");
var oneChecked = false;
var items = updates.selectedItem.getElementsByTagName("checkbox");
for (var i = 0; i < items.length; ++i) {
if (items[i].checked) {
oneChecked = true;
break;
}
}
var strings = document.getElementById("updateStrings");
gUpdateWizard.setButtonLabels(null, true,
"installButtonText", true,
null, false);
var text = strings.getString("foundInstructions");
document.getElementById("found").setAttribute("next", "installing");
document.documentElement.getButton("next").disabled = !oneChecked;
var foundInstructions = document.getElementById("foundInstructions");
while (foundInstructions.hasChildNodes())
foundInstructions.removeChild(foundInstructions.firstChild);
foundInstructions.appendChild(document.createTextNode(text));
}
};
var gInstallingPage = {
_installing : false,
_restartRequired : false,
_objs : [],
onPageShow: function ()
{
gUpdateWizard.setButtonLabels(null, true,
"nextButtonText", true,
null, true);
// Get XPInstallManager and kick off download/install
// process, registering us as an observer.
var items = [];
this._objs = [];
this._restartRequired = false;
gUpdateWizard.remainingExtensionUpdateCount = gUpdateWizard.itemsToUpdate.length;
var updates = document.getElementById("found.updates");
var checkboxes = updates.selectedItem.getElementsByTagName("checkbox");
for (var i = 0; i < checkboxes.length; ++i) {
if (checkboxes[i].type == "update" && checkboxes[i].checked) {
items.push(checkboxes[i].URL);
this._objs.push({ name: checkboxes[i].label });
}
}
var xpimgr = Components.classes["@mozilla.org/xpinstall/install-manager;1"]
.createInstance(Components.interfaces.nsIXPInstallManager);
xpimgr.initManagerFromChrome(items, items.length, this);
},
/////////////////////////////////////////////////////////////////////////////
// nsIXPIProgressDialog
onStateChange: function (aIndex, aState, aValue)
{
var strings = document.getElementById("updateStrings");
const nsIXPIProgressDialog = Components.interfaces.nsIXPIProgressDialog;
switch (aState) {
case nsIXPIProgressDialog.DOWNLOAD_START:
var label = strings.getFormattedString("downloadingPrefix", [this._objs[aIndex].name]);
var actionItem = document.getElementById("actionItem");
actionItem.value = label;
break;
case nsIXPIProgressDialog.DOWNLOAD_DONE:
case nsIXPIProgressDialog.INSTALL_START:
var label = strings.getFormattedString("installingPrefix", [this._objs[aIndex].name]);
var actionItem = document.getElementById("actionItem");
actionItem.value = label;
this._installing = true;
break;
case nsIXPIProgressDialog.INSTALL_DONE:
switch (aValue) {
case 999:
this._restartRequired = true;
break;
case 0:
--gUpdateWizard.remainingExtensionUpdateCount;
break;
}
break;
case nsIXPIProgressDialog.DIALOG_CLOSE:
this._installing = false;
var nextPage = this._errors ? "errors" : (this._restartRequired ? "restart" : "finished");
document.getElementById("installing").setAttribute("next", nextPage);
document.documentElement.advance();
break;
}
},
_objs: [],
_errors: false,
onProgress: function (aIndex, aValue, aMaxValue)
{
var downloadProgress = document.getElementById("downloadProgress");
downloadProgress.value = Math.ceil((aValue/aMaxValue) * 100);
}
};
var gErrorsPage = {
onPageShow: function ()
{
document.documentElement.getButton("finish").focus();
gUpdateWizard.succeeded = false;
},
onShowErrors: function ()
{
gUpdateWizard.showErrors("install", gInstallingPage._objs);
}
};
var gFinishedPage = {
onPageShow: function ()
{
gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
document.documentElement.getButton("finish").focus();
var iR = document.getElementById("incompatibleRemaining");
var iR2 = document.getElementById("incompatibleRemaining2");
var fEC = document.getElementById("finishedEnableChecking");
if (gUpdateWizard.shouldSuggestAutoChecking) {
iR.hidden = true;
iR2.hidden = false;
fEC.hidden = false;
fEC.click();
}
else {
iR.hidden = false;
iR2.hidden = true;
fEC.hidden = true;
}
if (gShowMismatch) {
document.getElementById("finishedMismatch").hidden = false;
document.getElementById("incompatibleAlert").hidden = false;
}
}
};
var gNoUpdatesPage = {
onPageShow: function (aEvent)
{
gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
document.documentElement.getButton("finish").focus();
if (gShowMismatch) {
document.getElementById("introUser").hidden = true;
document.getElementById("introMismatch").hidden = false;
document.getElementById("mismatchNoUpdates").hidden = false;
if (gUpdateWizard.shouldSuggestAutoChecking) {
document.getElementById("mismatchIncompatibleRemaining").hidden = true;
document.getElementById("mismatchIncompatibleRemaining2").hidden = false;
document.getElementById("mismatchFinishedEnableChecking").hidden = false;
}
}
gUpdateWizard.succeeded = false;
gUpdateWizard.checkForErrors("updateCheckErrorNotFound");
}
};

View File

@ -0,0 +1,217 @@
<?xml version="1.0"?>
<!DOCTYPE bindings SYSTEM "chrome://mozapps/locale/update/update.dtd">
<bindings id="updatesBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="updateCategorySet" extends="chrome://global/content/bindings/radio.xml#radiogroup">
<implementation>
<method name="computeSizes">
<body>
<![CDATA[
var kids = this._getRadioChildren();
for (var i = 0; i < kids.length; ++i)
kids[i].expandedHeight = kids[i]._content.boxObject.height;
this.removeAttribute("_uninitialized");
]]>
</body>
</method>
<field name="lastSelectedItem">null</field>
</implementation>
</binding>
<binding id="updateCategory" extends="chrome://global/content/bindings/radio.xml#radio">
<resources>
<stylesheet src="chrome://global/skin/radio.css"/>
<stylesheet src="chrome://mozapps/skin/update/update.css"/>
</resources>
<content>
<xul:hbox class="updateCategoryBox" xbl:inherits="selected,checked,disabled">
#ifdef MOZ_WIDGET_GTK2
<xul:hbox class="radio-spacer-box">
#endif
<xul:hbox class="radio-check-box1" xbl:inherits="selected,checked,disabled">
<xul:hbox class="radio-check-box2" flex="1">
<xul:image class="radio-check" xbl:inherits="selected,checked,disabled"/>
</xul:hbox>
</xul:hbox>
#ifdef MOZ_WIDGET_GTK2
</xul:hbox>
#endif
<xul:image class="updateCategoryIcon" xbl:inherits="src"/>
<xul:label class="updateCategoryLabel" xbl:inherits="xbl:text=label,accesskey,crop,selected" flex="1"/>
</xul:hbox>
<xul:vbox flex="1" class="updateCategoryContent">
<children/>
</xul:vbox>
</content>
<implementation implements="nsITimerCallback">
<property name="expandedHeight"
onget="return this.getAttribute('expandedHeight');"
onset="this.setAttribute('expandedHeight', val); return val;"/>
<method name="notify">
<parameter name="aTimer"/>
<body>
<![CDATA[
var newHeight;
if (this._destinationSize == 0) {
if (this._content.boxObject.height > 0) {
newHeight = this._content.boxObject.height - this._animateIncrement;
newHeight = newHeight < 0 ? 0 : newHeight;
this._content.style.height = newHeight + "px";
this._timer.initWithCallback(this, this._animateDelay,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}
else {
this._timer.cancel();
this._content.style.visibility = "collapse";
}
}
else {
if (this._content.boxObject.height <= this._destinationSize) {
newHeight = this._content.boxObject.height + this._animateIncrement;
newHeight = newHeight > this.expandedHeight ? this.expandedHeight : newHeight;
this._content.style.height = newHeight + "px";
this._timer.initWithCallback(this, this._animateDelay,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}
else
this._timer.cancel();
}
]]>
</body>
</method>
<method name="_setUpTimer">
<parameter name="aSelected"/>
<body>
<![CDATA[
if (!this._timer)
this._timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
else
this._timer.cancel();
this._content.style.visibility = "visible";
this._destinationSize = aSelected ? this.expandedHeight : 0;
this._timer.initWithCallback(this, this._animateDelay,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
]]>
</body>
</method>
<field name="_content">
document.getAnonymousElementByAttribute(this, "class", "updateCategoryContent");
</field>
<field name="_timer">null</field>
<field name="_animateDelay">50</field>
<field name="_animateIncrement">25</field>
<field name="_destinationSize">0</field>
</implementation>
<handlers>
<handler event="RadioStateChange">
<![CDATA[
/*
this._content.style.height = "0px";
if (this.radioGroup.lastSelectedItem)
this.radioGroup.lastSelectedItem._setUpTimer(false);
this.radioGroup.lastSelectedItem = this;
this._setUpTimer(true);*/
]]>
</handler>
</handlers>
</binding>
<binding id="updateItem" extends="chrome://global/content/bindings/checkbox.xml#checkbox">
<content>
#ifdef MOZ_WIDGET_GTK2
<xul:hbox class="checkbox-spacer-box">
#endif
<xul:image class="checkbox-check" xbl:inherits="checked,disabled"/>
#ifdef MOZ_WIDGET_GTK2
</xul:hbox>
<xul:hbox class="checkbox-label-center-box" flex="1">
#endif
<xul:hbox class="checkbox-label-box" flex="1">
<xul:label class="checkbox-label foundLabel" xbl:inherits="xbl:text=label,accesskey" flex="1"/>
<xul:label class="checkbox-label" value="&from.label;"/>
<xul:label class="checkbox-label foundSource" xbl:inherits="xbl:text=source,infoURL,accesskey,crop"/>
</xul:hbox>
#ifdef MOZ_WIDGET_GTK2
</xul:hbox>
#endif
</content>
<implementation>
<property name="type"
onget="return this.getAttribute('type');"
onset="this.setAttribute('type', val); return val;"/>
<property name="source"
onget="return this.getAttribute('source');"
onset="this.setAttribute('source', val); return val;"/>
<property name="URL"
onget="return this.getAttribute('URL');"
onset="this.setAttribute('URL', val); return val;"/>
<property name="infoURL"
onget="return this.getAttribute('infoURL');"
onset="this.setAttribute('infoURL', val); return val;"/>
<property name="internalName"
onget="return this.getAttribute('internalName');"
onset="this.setAttribute('internalName', val); return val;"/>
</implementation>
</binding>
<binding id="link" extends="chrome://global/content/bindings/text.xml#text-base">
<content>
<xul:label xbl:inherits="value=label,crop" class="linkLabel" flex="1"/>
</content>
<implementation>
<property name="href"
onget="return this.getAttribute('href');"
onset="this.setAttribute('href', val); return val;"/>
</implementation>
<handlers>
<handler event="keypress" keycode="VK_ENTER" action="this.click()" />
<handler event="keypress" keycode="VK_RETURN" action="this.click()" />
<handler event="click">
<![CDATA[
if (event.button != 0)
return;
# If we're not a browser, use the external protocol service to load the URI.
#ifndef MOZ_PHOENIX
var uri = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService)
.newURI(this.getAttribute("href"), null, null);
var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Components.interfaces.nsIExternalProtocolService);
if (protocolSvc.isExposedProtocol(uri.scheme))
protocolSvc.loadUrl(uri);
# If we're a browser, open a new browser window instead.
#else
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
var ary = Components.classes["@mozilla.org/supports-array;1"]
.createInstance(Components.interfaces.nsISupportsArray);
var url = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
url.data = this.getAttribute("href")
ary.AppendElement(url);
ww.openWindow(null, "chrome://browser/content/browser.xul",
"_blank", "chrome,all,dialog=no", ary);
#endif
]]>
</handler>
</handlers>
</binding>
</bindings>

View File

@ -14,15 +14,14 @@
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is The Extension Manager.
# The Original Code is The Extension Update Service.
#
# The Initial Developer of the Original Code is
# Ben Goodger.
# The Initial Developer of the Original Code is Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2004
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@bengoodger.com>
# Ben Goodger <ben@mozilla.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -39,36 +38,161 @@
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/extensions/update.css" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/skin/extensions/update.css" type="text/css"?>
<!DOCTYPE dialog [
<!DOCTYPE wizard [
<!ENTITY % updateDTD SYSTEM "chrome://mozapps/locale/extensions/update.dtd">
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%updateDTD;
%brandDTD;
]>
<dialog id="updateProgress" title="&update.title;"
style="width: 30em;"
<wizard id="updateWizard"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="cancel"
onload="gUpdateDialog.init();"
onunload="gUpdateDialog.uninit();"
ondialogcancel="gUpdateDialog.cancel();">
title="&updateWizard.title;"
windowtype="Update:Wizard"
onload="gUpdateWizard.init();"
onunload="gUpdateWizard.uninit();"
onwizardfinish="gUpdateWizard.onWizardFinish();"
onclose="return gUpdateWizard.onWizardClose(event);"
style="width: 47em; min-height: 35em;"
buttons="accept,cancel">
<script type="application/x-javascript" src="chrome://mozapps/content/extensions/update.js"/>
<stringbundleset id="updateSet">
<stringbundle id="brandStrings" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
<stringbundle id="updateStrings" src="chrome://mozapps/locale/extensions/update.properties"/>
</stringbundleset>
<label>&intro.label;</label>
<wizardpage id="mismatch" pageid="mismatch" next="checking"
label="&mismatch.title;"
onpageshow="gMismatchPage.onPageShow();">
<label>&mismatch.intro1.label;</label>
<separator class="thin"/>
<listbox id="mismatch.incompatible" flex="1"/>
<separator class="thin"/>
<label style="font-weight: bold;">&mismatch.intro2.label;</label>
<separator class="thin"/>
<label>&mismatch.intro3.label;</label>
</wizardpage>
<description id="items"/>
<wizardpage id="checking" pageid="checking" next="noupdates"
label="&checking.title;"
onpageshow="gUpdatePage.onPageShow();">
<progressmeter id="progress"/>
<label>&checking.intro.label;</label>
<separator class="thin"/>
<progressmeter id="checking.progress"/>
<hbox align="center">
<image id="checking.throbber" class="throbber"/>
<label id="checking.status" flex="1" crop="right">&checking.status;</label>
</hbox>
</wizardpage>
<wizardpage id="noupdates" pageid="noupdates"
label="&noupdates.title;"
onpageshow="gNoUpdatesPage.onPageShow();">
<label id="introUser">&noupdates.intro.user.label;</label>
<label id="introMismatch" hidden="true">&noupdates.intro.mismatch.label;</label>
<separator/>
<vbox id="mismatchNoUpdates" hidden="true">
<description id="mismatchIncompatibleRemaining" flex="1">
&noupdates.intro2.mismatch.label;
</description>
<description id="mismatchIncompatibleRemaining2" flex="1" hidden="true">
&noupdates.intro3.mismatch.label;
</description>
<separator class="thin"/>
<vbox align="left">
<checkbox label="&noupdates.enableChecking.label;"
id="mismatchFinishedEnableChecking" hidden="true"
oncommand="gUpdateWizard.shouldAutoCheck = this.checked;"/>
</vbox>
</vbox>
<hbox id="updateCheckErrorNotFound" hidden="true" align="center">
<description flex="1">
&updateCheckError.description;
</description>
<button label="&updateCheckError.label;" accesskey="&updateCheckError.accesskey;"
oncommand="gUpdateWizard.showUpdateCheckErrors();"/>
</hbox>
</wizardpage>
<wizardpage id="found" pageid="found" next="installing"
label="&found.title;"
onpageshow="gFoundPage.onPageShow();">
<label>&found.intro.label;</label>
<separator class="thin"/>
<radiogroup type="update-types" id="found.updates" flex="1" _uninitialized="true"
onselect="gFoundPage.onSelect(event);">
<radio type="update-type" id="addons" accesskey="&found.updatetype.addons.accesskey;" collapsed="true">
<description>&found.addons.label;</description>
<separator class="thin"/>
<vbox id="found.addons.list"/>
<label>.</label>
</radio>
</radiogroup>
<separator class="thin"/>
<label id="foundInstructions"/>
</wizardpage>
<wizardpage id="installing" pageid="installing" next="finished"
label="&installing.title;"
onpageshow="gInstallingPage.onPageShow();">
<label>&installing.intro.label;</label>
<progressmeter id="downloadProgress"/>
<hbox align="center">
<image id="installing.throbber" class="throbber"/>
<label id="actionItem" flex="1" crop="right"/>
</hbox>
<separator/>
</wizardpage>
<description id="status"/>
<wizardpage id="errors" pageid="errors"
label="&errors.title;"
align="right"
onpageshow="gErrorsPage.onPageShow();">
<label>&errors.intro.label;</label>
<separator/>
<button label="&errors.details.label;" accesskey="&errors.details.accesskey;"
oncommand="gErrorsPage.onShowErrors();"/>
<separator/>
</wizardpage>
<wizardpage id="finished" pageid="finished"
label="&finished.title;"
onpageshow="gFinishedPage.onPageShow();">
</dialog>
<label id="updated">&finished.updated.label;</label>
<separator/>
<hbox id="incompatibleAlert" align="top" hidden="true">
<image id="alert"/>
<description id="incompatibleRemaining" flex="1">&finished.remaining.label;</description>
<description id="incompatibleRemaining2" flex="1">&finished.remaining2.label;</description>
</hbox>
<vbox align="left">
<checkbox class="indent" label="&finished.enableChecking.label;" id="finishedEnableChecking"
oncommand="gUpdateWizard.shouldAutoCheck = this.checked;"/>
</vbox>
<separator flex="1"/>
<label id="finishedMismatch" hidden="true">&finished.mismatch.label;</label>
</wizardpage>
</wizard>

View File

@ -194,7 +194,7 @@ interface nsIExtensionDownloadListener : nsISupports
* XXXben - Some of this stuff should go into a management-ey interface,
* some into an app-startup-ey interface.
*/
[scriptable, uuid(cb90632b-4838-44c3-991c-0964e918af4b)]
[scriptable, uuid(344c6fd1-ed48-4c84-a472-abdec533d1e2)]
interface nsIExtensionManager : nsISupports
{
/**
@ -284,7 +284,7 @@ interface nsIExtensionManager : nsISupports
* true if it should only find newer target application compatibility
* information for the currently installed version.
*/
void update([array, size_is(itemCount)] in nsIUpdateItem items,
void update([array, size_is(itemCount)] in nsIUpdateItem items,
in unsigned long itemCount,
in unsigned long versionUpdateOnly);
@ -311,6 +311,25 @@ interface nsIExtensionManager : nsISupports
void getItemList(in unsigned long type, out unsigned long itemCount,
[retval, array, size_is(itemCount)] out nsIUpdateItem items);
/**
* Retrieves a list of nsIUpdateItems of items that are incompatible
* with the supplied parameters.
* @param id
* The id of the application to check compatibility against
* @param version
* The version of the application to check compatibility against
* @param type
* The type of item to return
* @param countRef
* The XPCJS reference to the number of items returned.
* @returns An array of incompatible nsIUpdateItems.
*/
void getIncompatibleItemList(in AString id,
in AString version,
in unsigned long type,
out unsigned long itemCount,
[retval, array, size_is(itemCount)] out nsIUpdateItem items);
/**
* The Extensions Datasource
* XXXben - the datasource should be registered with the RDF system, so it

View File

@ -132,6 +132,7 @@ const URI_FINALIZE_DIALOG = "chrome://mozapps/content/extensions/fin
const URI_EXTENSIONS_PROPERTIES = "chrome://mozapps/locale/extensions/extensions.properties";
const URI_BRAND_PROPERTIES = "chrome://branding/locale/brand.properties";
const URI_DOWNLOADS_PROPERTIES = "chrome://mozapps/locale/downloads/downloads.properties";
const URI_EXTENSION_UPDATE_DIALOG = "chrome://mozapps/content/extensions/update.xul";
const INSTALLERROR_SUCCESS = 0;
const INSTALLERROR_INVALID_VERSION = -1;
@ -2998,14 +2999,8 @@ ExtensionManager.prototype = {
// Now disable the items so they won't hurt anything.
for (var i = 0; i < items.length; ++i)
this.disableItem(items[i].id);
// Check for newer available versions.
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates(items, items.length, nsIUpdateItem.TYPE_ADDON,
nsIUpdateService.SOURCE_EVENT_MISMATCH,
null);
this._showMismatchWindow(items);
needsRestart = true;
}
}
@ -3023,6 +3018,40 @@ ExtensionManager.prototype = {
return needsRestart;
},
/**
* Shows the "Incompatible Items Found" UI
* @param items
* An array of items to show in the Mismatch UI
*/
_showMismatchWindow: function(items) {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var wizard = wm.getMostRecentWindow("Update:Wizard");
if (wizard)
wizard.focus();
else {
var ary = Components.classes["@mozilla.org/supports-array;1"]
.createInstance(Components.interfaces.nsISupportsArray);
var updateTypes = Components.classes["@mozilla.org/supports-PRUint8;1"]
.createInstance(Components.interfaces.nsISupportsPRUint8);
updateTypes.data = nsIUpdateItem.TYPE_ADDON;
ary.AppendElement(updateTypes);
var sourceEvent = Components.classes["@mozilla.org/supports-PRUint8;1"]
.createInstance(Components.interfaces.nsISupportsPRBool);
sourceEvent.data = true;
ary.AppendElement(sourceEvent);
for (var i = 0; i < items.length; ++i)
ary.AppendElement(items[i]);
var features = "chrome,centerscreen,dialog,titlebar,modal";
// This *must* be modal so as not to break startup! This code is invoked before
// the main event loop is initiated (via checkForMismatches).
var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
ww.openWindow(null, URI_EXTENSION_UPDATE_DIALOG, "", features, ary);
}
},
/**
* Write the Extensions List and the Startup Cache
@ -3228,7 +3257,7 @@ ExtensionManager.prototype = {
}
// Check the target application range specified by the extension metadata.
if (!this.datasource.isCompatible(installManifest, gInstallManifestRoot))
if (!this.datasource.isCompatible(installManifest, gInstallManifestRoot, undefined))
installData.error = INSTALLERROR_INCOMPATIBLE_VERSION;
return installData;
@ -3983,6 +4012,15 @@ ExtensionManager.prototype = {
getItemList: function(type, countRef) {
return this.datasource.getItemList(type, countRef);
},
/**
* See nsIExtensionManager.idl
*/
getIncompatibleItemList: function(id, version, type, countRef) {
var items = this.datasource.getIncompatibleItemList(id, version, type);
countRef.value = items.length;
return items;
},
/**
* Move an Item to the index of another item in its container.
@ -4882,16 +4920,24 @@ ExtensionsDataSource.prototype = {
* datasource or an Install Manifest.
* @param source
* The RDF Resource of the item to inspect for compatibility.
* @returns true if the item is compatible with this version of the application,
* false, otherwise.
* @param version
* The version of the application we are checking for compatibility
* against. If this parameter is undefined, the version of the running
* application is used.
* @returns true if the item is compatible with this version of the
* application, false, otherwise.
*/
isCompatible: function (datasource, source) {
isCompatible: function (datasource, source, version) {
// The Default Theme is always compatible.
if (source.EqualsNode(this._defaultTheme))
return true;
var appVersion = getCharPrefWithDefault(PREF_EM_APP_EXTENSIONS_VERSION,
gApp.version);
if (version === undefined) {
version = getCharPrefWithDefault(PREF_EM_APP_EXTENSIONS_VERSION,
gApp.version);
}
var appID = gApp.ID;
var targets = datasource.GetTargets(source, EM_R("targetApplication"), true);
@ -4905,8 +4951,8 @@ ExtensionsDataSource.prototype = {
var maxVersion = stringData(datasource.GetTarget(targetApp, maxVersionRes, true));
if (id == appID) {
var versionChecker = getVersionChecker();
return ((versionChecker.compare(appVersion, minVersion) >= 0) &&
(versionChecker.compare(appVersion, maxVersion) <= 0));
return ((versionChecker.compare(version, minVersion) >= 0) &&
(versionChecker.compare(version, maxVersion) <= 0));
}
}
return false;
@ -4917,7 +4963,7 @@ ExtensionsDataSource.prototype = {
* @param appID
* The ID of the application - XXXben unused?
* @param appVersion
* The Version of the application - XXXben - unused?
* The Version of the application to check for incompatibility against.
* @param desiredType
* The nsIUpdateItem type of items to look for
* @returns An array of nsIUpdateItems that are incompatible with the application
@ -4931,7 +4977,7 @@ ExtensionsDataSource.prototype = {
var item = elements.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
var id = stripPrefix(item.Value, PREFIX_ITEM_URI);
var type = this.getItemProperty(id, "type");
if (type != -1 && (type & desiredType) && !this.isCompatible(this, item))
if (type != -1 && (type & desiredType) && !this.isCompatible(this, item, appVersion))
items.push(this.getItemForID(id));
}
return items;

View File

@ -16,6 +16,10 @@ toolkit.jar:
* content/mozapps/extensions/extensions.js (extensions/content/extensions.js)
* content/mozapps/extensions/extensions.xml (extensions/content/extensions.xml)
* content/mozapps/extensions/extensions.css (extensions/content/extensions.css)
* content/mozapps/extensions/update.xul (extensions/content/update.xul)
* content/mozapps/extensions/update.xml (extensions/content/update.xml)
* content/mozapps/extensions/update.js (extensions/content/update.js)
content/mozapps/extensions/update.css (extensions/content/update.css)
* content/mozapps/extensions/about.xul (extensions/content/about.xul)
* content/mozapps/extensions/about.js (extensions/content/about.js)
* content/mozapps/extensions/finalize.xul (extensions/content/finalize.xul)
@ -31,10 +35,12 @@ toolkit.jar:
* content/mozapps/preferences/removemp.xul (preferences/removemp.xul)
* content/mozapps/preferences/preferences.css (preferences/preferences.css)
* content/mozapps/preferences/preferences.xml (preferences/preferences.xml)
* content/mozapps/update/update.xul (update/content/update.xul)
* content/mozapps/update/update.js (update/content/update.js)
content/mozapps/update/updates.css (update/content/updates.css)
* content/mozapps/update/updates.xul (update/content/updates.xul)
* content/mozapps/update/updates.js (update/content/updates.js)
* content/mozapps/update/updates.xml (update/content/updates.xml)
* content/mozapps/update/update.css (update/content/update.css)
* content/mozapps/update/incompatible.xul (update/content/incompatible.xul)
* content/mozapps/update/incompatible.js (update/content/incompatible.js)
* content/mozapps/update/errors.xul (update/content/errors.xul)
* content/mozapps/shared/richview.xml (shared/content/richview.xml)
content/mozapps/plugins/pluginInstallerWizard.xul (plugins/content/pluginInstallerWizard.xul)

View File

@ -0,0 +1,20 @@
function init() {
var updateBundle = document.getElementById("updateBundle");
var incompatibleItems = document.getElementById("incompatibleItems");
var items = window.arguments[0];
for (var i = 0; i < items.length; ++i) {
var listitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"listitem");
var itemName = updateBundle.getFormattedString("updateName", [items[i].name, items[i].version]);
listitem.setAttribute("label", itemName);
incompatibleItems.appendChild(listitem);
}
var closebuttonlabel = document.documentElement.getAttribute("closebuttonlabel");
var cancelbutton = document.documentElement.getButton("cancel");
cancelbutton.label = closebuttonlabel;
cancelbutton.focus();
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE dialog [
<!ENTITY % incompatibleDTD SYSTEM "chrome://mozapps/locale/update/incompatible.dtd">
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%incompatibleDTD;
%brandDTD;
]>
<?xml-stylesheet href="chrome://global/skin/"?>
<?xml-stylesheet href="chrome://mozapps/content/update/updates.css"?>
<dialog id="incompatible"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 35em;"
buttons="cancel" closebuttonlabel="&closebutton.label;"
title="&incompatible.title;"
onload="init();">
<script type="application/x-javascript"
src="chrome://mozapps/content/update/incompatible.js"/>
<stringbundle id="updateBundle"
src="chrome://mozapps/locale/update/updates.properties"/>
<label>&incompatible.intro;</label>
<separator/>
<listbox id="incompatibleItems" rows="10"/>
<separator/>
<label>&incompatible.update;</label>
<separator class="thin"/>
<label class="bold">&incompatible.suffix;</label>
<separator/>
</dialog>

File diff suppressed because it is too large Load Diff

View File

@ -1,253 +0,0 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is The Update Service.
#
# The Initial Developer of the Original Code is
# Ben Goodger.
# Portions created by the Initial Developer are Copyright (C) 2004
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@bengoodger.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/update/update.css" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/skin/update/update.css" type="text/css"?>
<!DOCTYPE wizard [
<!ENTITY % updateDTD SYSTEM "chrome://mozapps/locale/update/update.dtd">
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%updateDTD;
%brandDTD;
]>
<wizard id="updateWizard"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&updateWizard.title;"
windowtype="Update:Wizard"
onload="gUpdateWizard.init();"
onunload="gUpdateWizard.uninit();"
onwizardfinish="gUpdateWizard.onWizardFinish();"
onclose="return gUpdateWizard.onWizardClose(event);"
style="width: 47em; min-height: 35em;"
buttons="accept,cancel">
<script type="application/x-javascript" src="chrome://mozapps/content/update/update.js"/>
<stringbundleset id="updateSet">
<stringbundle id="brandStrings" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="updateStrings" src="chrome://mozapps/locale/update/update.properties"/>
</stringbundleset>
<wizardpage id="mismatch" pageid="mismatch" next="checking"
label="&mismatch.title;"
onpageshow="gMismatchPage.onPageShow();">
<label>&mismatch.intro1.label;</label>
<separator class="thin"/>
<listbox id="mismatch.incompatible" flex="1"/>
<separator class="thin"/>
<label style="font-weight: bold;">&mismatch.intro2.label;</label>
<separator class="thin"/>
<label>&mismatch.intro3.label;</label>
</wizardpage>
<wizardpage id="checking" pageid="checking" next="noupdates"
label="&checking.title;"
onpageshow="gUpdatePage.onPageShow();">
<label>&checking.intro.label;</label>
<separator class="thin"/>
<progressmeter id="checking.progress"/>
<hbox align="center">
<image id="checking.throbber" class="throbber"/>
<label id="checking.status" flex="1" crop="right">&checking.status;</label>
</hbox>
</wizardpage>
<wizardpage id="noupdates" pageid="noupdates"
label="&noupdates.title;"
onpageshow="gNoUpdatesPage.onPageShow();">
<label id="introUser">&noupdates.intro.user.label;</label>
<label id="introMismatch" hidden="true">&noupdates.intro.mismatch.label;</label>
<separator/>
<vbox id="mismatchNoUpdates" hidden="true">
<description id="mismatchIncompatibleRemaining" flex="1">
&noupdates.intro2.mismatch.label;
</description>
<description id="mismatchIncompatibleRemaining2" flex="1" hidden="true">
&noupdates.intro3.mismatch.label;
</description>
<separator class="thin"/>
<vbox align="left">
<checkbox label="&noupdates.enableChecking.label;"
id="mismatchFinishedEnableChecking" hidden="true"
oncommand="gUpdateWizard.shouldAutoCheck = this.checked;"/>
</vbox>
</vbox>
<hbox id="updateCheckErrorNotFound" hidden="true" align="center">
<description flex="1">
&updateCheckError.description;
</description>
<button label="&updateCheckError.label;" accesskey="&updateCheckError.accesskey;"
oncommand="gUpdateWizard.showUpdateCheckErrors();"/>
</hbox>
</wizardpage>
<wizardpage id="found" pageid="found" next="installing"
label="&found.title;"
onpageshow="gFoundPage.onPageShow();">
<label>&found.intro.label;</label>
<separator class="thin"/>
<radiogroup type="update-types" id="found.updates" flex="1" _uninitialized="true"
onselect="gFoundPage.onSelect(event);">
<radio type="update-type" id="patches" accesskey="&found.updatetype.patches.accesskey;" collapsed="true">
<description>&found.criticalUpdates.label;</description>
<separator class="thin"/>
<vbox id="found.criticalUpdates.list"/>
<separator class="thin"/>
<description>&found.criticalUpdates.info;</description>
<label>.</label>
</radio>
<radio type="update-type" id="app" collapsed="true">
<label id="found.app.label"/>
<separator class="thin"/>
<label id="found.app.features" hidden="true"/>
<vbox id="found.app.featuresList"/>
<separator class="thin"/>
<link id="found.app.infoLink" label="&found.app.infoLink;"/>
<label>.</label>
</radio>
<radio type="update-type" id="components" accesskey="&found.updatetype.components.accesskey;" collapsed="true">
<description>&found.components.label;</description>
<separator class="thin"/>
<vbox id="found.components.list"/>
<separator class="thin"/>
<description>&found.components.info;</description>
<label>.</label>
</radio>
<radio type="update-type" id="addons" accesskey="&found.updatetype.addons.accesskey;" collapsed="true">
<description>&found.addons.label;</description>
<separator class="thin"/>
<vbox id="found.addons.list"/>
<label>.</label>
</radio>
<radio type="update-type" id="found.languages.header" accesskey="&found.updatetype.languages.accesskey;" collapsed="true">
<description>&found.languages.label;</description>
<separator class="thin"/>
<vbox id="found.languages.list"/>
<label>.</label>
</radio>
</radiogroup>
<separator class="thin"/>
<label id="foundInstructions"/>
</wizardpage>
<wizardpage id="optional" pageid="optional" next="installing"
label="&optional.title;"
onpageshow="gOptionalPage.onPageShow();">
<label>&optional.intro.label;</label>
<separator class="thin"/>
<vbox id="optionalItemsList" flex="1" align="left"
style="overflow: auto;"
onmouseover="gOptionalPage.onListMouseOver(event);"
onmouseout="gOptionalPage.onListMouseOut(event);"
oncommand="gOptionalPage.onCommand(event);"/>
<separator/>
<description id="optionalDescription" style="height: 3em;"/>
</wizardpage>
<wizardpage id="installing" pageid="installing" next="finished"
label="&installing.title;"
onpageshow="gInstallingPage.onPageShow();">
<label>&installing.intro.label;</label>
<progressmeter id="downloadProgress"/>
<hbox align="center">
<image id="installing.throbber" class="throbber"/>
<label id="actionItem" flex="1" crop="right"/>
</hbox>
<separator/>
</wizardpage>
<wizardpage id="errors" pageid="errors"
label="&errors.title;"
align="right"
onpageshow="gErrorsPage.onPageShow();">
<label>&errors.intro.label;</label>
<separator/>
<button label="&errors.details.label;" accesskey="&errors.details.accesskey;"
oncommand="gErrorsPage.onShowErrors();"/>
<separator/>
</wizardpage>
<wizardpage id="finished" pageid="finished"
label="&finished.title;"
onpageshow="gFinishedPage.onPageShow();">
<label id="updated">&finished.updated.label;</label>
<separator/>
<hbox id="incompatibleAlert" align="top" hidden="true">
<image id="alert"/>
<description id="incompatibleRemaining" flex="1">&finished.remaining.label;</description>
<description id="incompatibleRemaining2" flex="1">&finished.remaining2.label;</description>
</hbox>
<vbox align="left">
<checkbox class="indent" label="&finished.enableChecking.label;" id="finishedEnableChecking"
oncommand="gUpdateWizard.shouldAutoCheck = this.checked;"/>
</vbox>
<separator flex="1"/>
<label id="finishedMismatch" hidden="true">&finished.mismatch.label;</label>
</wizardpage>
<wizardpage id="restart" pageid="restart"
label="&restart.title;"
onpageshow="gRestartPage.onPageShow();">
<label>&restart.updated.label;</label>
</wizardpage>
</wizard>

View File

@ -0,0 +1,135 @@
.wizard-header {
display: none;
}
.wizard-buttons {
display: none;
}
.wizard-page-box {
margin: 0px;
}
.content {
margin: 10px 44px 10px 44px;
}
link {
-moz-binding: url("chrome://mozapps/content/update/updates.xml#link");
-moz-user-focus: normal;
color: blue;
border: 1px solid transparent;
}
.linkLabel {
cursor: pointer;
text-decoration: underline !important;
}
link:hover:active {
color: red;
}
link:focus {
border: 1px dotted black;
}
#updateName {
font-weight: bold;
font-size: x-large;
}
#updateType[type=major] {
font-weight: bold;
color: #C00000;
}
#updateType[type=minor] {
font-weight: bold;
color: #FF0000;
}
#updateForMoreInfo {
margin-left: 5px;
}
#updateImage {
margin-right: 5px;
}
#update-info {
border-bottom: 2px solid;
-moz-border-bottom-colors: ThreeDFace ThreeDHighlight;
-moz-appearance: listbox;
margin: 10px;
background-color: #FFFFFF;
}
#update-info-inner {
background-color: InfoBackground;
color: InfoText;
display: -moz-box;
padding: 7px 5px 7px 7px;
}
#updateAvailable {
margin: 5px;
}
#alertImage {
list-style-image: url("chrome://global/skin/icons/Warning.png");
margin-right: 5px;
}
.action-button-box {
margin: 7px;
}
#download-button {
font-weight: bold;
}
.bold {
font-weight: bold;
}
#updatesView {
-moz-binding: url("chrome://mozapps/skin/shared/richview.xml#richview");
overflow: auto;
}
update {
-moz-binding: url("chrome://mozapps/content/update/updates.xml#update");
-moz-box-orient: vertical;
background-color: #FFFFFF;
border-bottom: 1px dotted #C0C0C0;
padding: 5px;
}
update[state="downloading"] {
-moz-binding: url("chrome://mozapps/content/update/updates.xml#update-downloading");
}
#updatesView[showcompletedupdates=true] > update {
display: none
}
#incompatibleWarning {
margin-right: 50px;
}
#downloadingIntro {
margin: 10px 10px 0px 10px;
}
#downloadingFooter {
margin: 0px 4px 7px 4px;
}
.update-item-name {
font-weight: bold;
}
.update-item-pause {
font-size: smaller;
}

View File

@ -0,0 +1,219 @@
const nsIUpdateItem = Components.interfaces.nsIUpdateItem;
const nsIIncrementalDownload = Components.interfaces.nsIIncrementalDownload;
/**
* Logs a string to the error console.
* @param string
* The string to write to the error console..
*/
function LOG(string) {
dump("*** " + string + "\n");
}
var gUpdates = {
updates: null,
onClose: function() {
var objects = {
checking: gCheckingPage,
updatesfound: gUpdatesAvailablePage
};
var pageid = document.documentElement.currentPage.pageid;
if ("onClose" in objects[pageid])
objects[pageid].onClose();
},
}
var gCheckingPage = {
/**
* The nsIUpdateChecker that is currently checking for updates. We hold onto
* this so we can cancel the update check if the user closes the window.
*/
_checker: null,
/**
* Starts the update check when the page is shown.
*/
onPageShow: function() {
var wiz = document.documentElement;
wiz.getButton("next").disabled = true;
var aus = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIApplicationUpdateService);
this._checker = aus.checkForUpdates(this.updateListener);
},
/**
* The user has closed the window, either by pressing cancel or using a Window
* Manager control, so stop checking for updates.
*/
onClose: function() {
if (this._checker)
this._checker.stopChecking();
},
updateListener: {
/**
* See nsIUpdateCheckListener.idl
*/
onProgress: function(request, position, totalSize) {
var pm = document.getElementById("checkingProgress");
checkingProgress.setAttribute("mode", "normal");
checkingProgress.setAttribute("value", Math.floor(100 * (position/totalSize)));
},
/**
* See nsIUpdateCheckListener.idl
*/
onCheckComplete: function(updates, updateCount) {
gUpdates.updates = updates;
document.documentElement.advance();
},
/**
* See nsIUpdateCheckListener.idl
*/
onError: function() {
dump("*** UpdateCheckListener: ERROR\n");
},
/**
* See nsISupports.idl
*/
QueryInterface: function(iid) {
if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
!aIID.equals(Components.interfaces.nsISupports))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
}
}
};
var gUpdatesAvailablePage = {
_incompatibleItems: null,
onPageShow: function() {
var newestUpdate = gUpdates.updates[0];
var vc = Components.classes["@mozilla.org/updates/version-checker;1"]
.createInstance(Components.interfaces.nsIVersionChecker);
for (var i = 0; i < gUpdates.updates.length; ++i) {
if (vc.compare(gUpdates.updates[i].version, newestUpdate.version) > 0)
newestVersion = gUpdates.updates[i];
}
var updateStrings = document.getElementById("updateStrings");
var brandStrings = document.getElementById("brandStrings");
var brandName = brandStrings.getString("brandShortName");
var updateName = updateStrings.getFormattedString("updateName",
[brandName, newestVersion.version]);
var updateNameElement = document.getElementById("updateName");
updateNameElement.value = updateName;
var displayType = updateStrings.getString("updateType_" + newestVersion.type);
var updateTypeElement = document.getElementById("updateType");
updateTypeElement.setAttribute("type", newestVersion.type);
var intro = updateStrings.getFormattedString("introType_" + newestVersion.type, [brandName]);
while (updateTypeElement.hasChildNodes())
updateTypeElement.removeChild(updateTypeElement.firstChild);
updateTypeElement.appendChild(document.createTextNode(intro));
var updateMoreInfoURL = document.getElementById("updateMoreInfoURL");
updateMoreInfoURL.href = newestVersion.detailsurl;
var em = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
var items = em.getIncompatibleItemList("", newestVersion.version,
nsIUpdateItem.TYPE_ADDON, { });
if (items.length > 0) {
// There are addons that are incompatible with this update, so show the
// warning message.
var incompatibleWarning = document.getElementById("incompatibleWarning");
incompatibleWarning.hidden = false;
this._incompatibleItems = items;
}
var dlButton = document.getElementById("download-button");
dlButton.focus();
},
showIncompatibleItems: function() {
openDialog("chrome://mozapps/content/update/incompatible.xul", "",
"dialog,centerscreen,modal,resizable,titlebar", this._incompatibleItems);
}
};
var gDownloadingPage = {
onPageShow: function() {
// Build the UI for the active download
var update = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
"update");
update.setAttribute("state", "downloading");
update.setAttribute("name", "Firefox 1.0.4");
update.setAttribute("status", "Blah");
update.setAttribute("url", "http://www.bengoodger.com/");
update.id = "activeDownloadItem";
var updatesView = document.getElementById("updatesView");
updatesView.appendChild(update);
// Add this UI as a listener for active downloads
var updates =
Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIApplicationUpdateService);
for (var i = 0; i < gUpdates.updates.length; ++i)
updates.downloadUpdate(gUpdates.updates[i]);
updates.addDownloadListener(this);
// Build the UI for previously installed updates
// ...
},
onClose: function() {
// Remove ourself as a download listener so that we don't continue to be
// fed progress and state notifications after the UI we're updating has
// gone away.
var updates =
Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIApplicationUpdateService);
updates.removeDownloadListener(this);
},
showCompletedUpdatesChanged: function(checkbox) {
var updatesView = document.getElementById("updatesView");
updatesView.setAttribute("showcompletedupdates", checkbox.checked);
},
onStartRequest: function(request, context) {
request.QueryInterface(nsIIncrementalDownload);
LOG("gDownloadingPage.onStartRequest: " + request.URI.spec);
},
onProgress: function(request, context, progress, maxProgress) {
request.QueryInterface(nsIIncrementalDownload);
LOG("gDownloadingPage.onProgress: " + request.URI.spec + ", " + progress + "/" + maxProgress);
var active = document.getElementById("activeDownloadItem");
active.setAttribute("progress", Math.floor(100 * (progress/maxProgress)));
},
onStatus: function(request, context, status, statusText) {
request.QueryInterface(nsIIncrementalDownload);
LOG("gDownloadingPage.onStatus: " + request.URI.spec + " status = " + status + ", text = " + statusText);
},
onStopRequest: function(request, context, status) {
request.QueryInterface(nsIIncrementalDownload);
LOG("gDownloadingPage.onStopRequest: " + request.URI.spec + ", status = " + status);
},
/**
* See nsISupports.idl
*/
QueryInterface: function(iid) {
if (!iid.equals(Components.interfaces.nsIRequestObserver) &&
!iid.equals(Components.interfaces.nsIProgressEventSink) &&
!iid.equals(Components.interfaces.nsISupports))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
}
};

View File

@ -1,266 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE bindings SYSTEM "chrome://mozapps/locale/update/update.dtd">
<!DOCTYPE bindings SYSTEM "chrome://mozapps/locale/update/updates.dtd">
<bindings id="updatesBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="updateStatusbarNotification"
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image">
<resources>
<stylesheet src="chrome://mozapps/skin/update/update.css"/>
</resources>
<implementation implements="nsIObserver">
<destructor>
<![CDATA[
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.removeObserver(this, "Update:Ended");
os.removeObserver(this, "Update:Extension:Item-Ended");
os.removeObserver(this, "Update:App:Ended");
]]>
</destructor>
<method name="init">
<body>
<![CDATA[
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.addObserver(this, "Update:Ended", false);
os.addObserver(this, "Update:Extension:Item-Ended", false);
os.addObserver(this, "Update:App:Ended", false);
this.refreshData();
]]>
</body>
</method>
<method name="observe">
<parameter name="aSubject"/>
<parameter name="aTopic"/>
<parameter name="aData"/>
<body>
<![CDATA[
switch (aTopic) {
case "Update:Extension:Item-Ended":
case "Update:App:Ended":
case "Update:Ended":
this.refreshData();
}
]]>
</body>
</method>
<method name="refreshData">
<body>
<![CDATA[
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
this.severity = updates.updateSeverity;
this.updateCount = updates.updateCount;
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
var updateStrings = sbs.createBundle("chrome://mozapps/locale/update/update.properties");
var key;
if (this.updateCount > 0)
key = "updatesAvailableTooltip-" + this.severity;
else
key = "updatesCheckForUpdatesTooltip";
var tooltip = updateStrings.GetStringFromName(key);
this.setAttribute("tooltiptext", tooltip);
]]>
</body>
</method>
<method name="showUpdates">
<body>
<![CDATA[
var updates = Components.classes["@mozilla.org/updates/update-service;1"]
.getService(Components.interfaces.nsIUpdateService);
updates.checkForUpdates([], 0, Components.interfaces.nsIUpdateItem.TYPE_ANY,
Components.interfaces.nsIUpdateService.SOURCE_EVENT_USER,
window);
]]>
</body>
</method>
<property name="severity" onset="this.setAttribute('severity', val); return val;"
onget="return this.getAttribute('severity');"/>
<property name="updateCount" onset="this.setAttribute('updateCount', val); return val;"
onget="return this.getAttribute('updateCount');"/>
</implementation>
<handlers>
<handler event="command">
<![CDATA[
this.showUpdates();
]]>
</handler>
</handlers>
</binding>
<binding id="updateCategorySet" extends="chrome://global/content/bindings/radio.xml#radiogroup">
<implementation>
<method name="computeSizes">
<body>
<![CDATA[
var kids = this._getRadioChildren();
for (var i = 0; i < kids.length; ++i)
kids[i].expandedHeight = kids[i]._content.boxObject.height;
this.removeAttribute("_uninitialized");
]]>
</body>
</method>
<field name="lastSelectedItem">null</field>
</implementation>
</binding>
<binding id="updateCategory" extends="chrome://global/content/bindings/radio.xml#radio">
<resources>
<stylesheet src="chrome://global/skin/radio.css"/>
<stylesheet src="chrome://mozapps/skin/update/update.css"/>
</resources>
<content>
<xul:hbox class="updateCategoryBox" xbl:inherits="selected,checked,disabled">
#ifdef MOZ_WIDGET_GTK2
<xul:hbox class="radio-spacer-box">
#endif
<xul:hbox class="radio-check-box1" xbl:inherits="selected,checked,disabled">
<xul:hbox class="radio-check-box2" flex="1">
<xul:image class="radio-check" xbl:inherits="selected,checked,disabled"/>
</xul:hbox>
</xul:hbox>
#ifdef MOZ_WIDGET_GTK2
</xul:hbox>
#endif
<xul:image class="updateCategoryIcon" xbl:inherits="src"/>
<xul:label class="updateCategoryLabel" xbl:inherits="xbl:text=label,accesskey,crop,selected" flex="1"/>
</xul:hbox>
<xul:vbox flex="1" class="updateCategoryContent">
<children/>
</xul:vbox>
</content>
<implementation implements="nsITimerCallback">
<property name="expandedHeight"
onget="return this.getAttribute('expandedHeight');"
onset="this.setAttribute('expandedHeight', val); return val;"/>
<method name="notify">
<parameter name="aTimer"/>
<body>
<![CDATA[
var newHeight;
if (this._destinationSize == 0) {
if (this._content.boxObject.height > 0) {
newHeight = this._content.boxObject.height - this._animateIncrement;
newHeight = newHeight < 0 ? 0 : newHeight;
this._content.style.height = newHeight + "px";
this._timer.initWithCallback(this, this._animateDelay,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}
else {
this._timer.cancel();
this._content.style.visibility = "collapse";
}
}
else {
if (this._content.boxObject.height <= this._destinationSize) {
newHeight = this._content.boxObject.height + this._animateIncrement;
newHeight = newHeight > this.expandedHeight ? this.expandedHeight : newHeight;
this._content.style.height = newHeight + "px";
this._timer.initWithCallback(this, this._animateDelay,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}
else
this._timer.cancel();
}
]]>
</body>
</method>
<method name="_setUpTimer">
<parameter name="aSelected"/>
<body>
<![CDATA[
if (!this._timer)
this._timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
else
this._timer.cancel();
this._content.style.visibility = "visible";
this._destinationSize = aSelected ? this.expandedHeight : 0;
this._timer.initWithCallback(this, this._animateDelay,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
]]>
</body>
</method>
<field name="_content">
document.getAnonymousElementByAttribute(this, "class", "updateCategoryContent");
</field>
<field name="_timer">null</field>
<field name="_animateDelay">50</field>
<field name="_animateIncrement">25</field>
<field name="_destinationSize">0</field>
</implementation>
<handlers>
<handler event="RadioStateChange">
<![CDATA[
/*
this._content.style.height = "0px";
if (this.radioGroup.lastSelectedItem)
this.radioGroup.lastSelectedItem._setUpTimer(false);
this.radioGroup.lastSelectedItem = this;
this._setUpTimer(true);*/
]]>
</handler>
</handlers>
</binding>
<binding id="updateItem" extends="chrome://global/content/bindings/checkbox.xml#checkbox">
<content>
#ifdef MOZ_WIDGET_GTK2
<xul:hbox class="checkbox-spacer-box">
#endif
<xul:image class="checkbox-check" xbl:inherits="checked,disabled"/>
#ifdef MOZ_WIDGET_GTK2
</xul:hbox>
<xul:hbox class="checkbox-label-center-box" flex="1">
#endif
<xul:hbox class="checkbox-label-box" flex="1">
<xul:label class="checkbox-label foundLabel" xbl:inherits="xbl:text=label,accesskey" flex="1"/>
<xul:label class="checkbox-label" value="&from.label;"/>
<xul:label class="checkbox-label foundSource" xbl:inherits="xbl:text=source,infoURL,accesskey,crop"/>
</xul:hbox>
#ifdef MOZ_WIDGET_GTK2
</xul:hbox>
#endif
</content>
<implementation>
<property name="type"
onget="return this.getAttribute('type');"
onset="this.setAttribute('type', val); return val;"/>
<property name="source"
onget="return this.getAttribute('source');"
onset="this.setAttribute('source', val); return val;"/>
<property name="URL"
onget="return this.getAttribute('URL');"
onset="this.setAttribute('URL', val); return val;"/>
<property name="infoURL"
onget="return this.getAttribute('infoURL');"
onset="this.setAttribute('infoURL', val); return val;"/>
<property name="internalName"
onget="return this.getAttribute('internalName');"
onset="this.setAttribute('internalName', val); return val;"/>
</implementation>
</binding>
<binding id="link" extends="chrome://global/content/bindings/text.xml#text-base">
<content>
<xul:label xbl:inherits="value=label,crop" class="linkLabel" flex="1"/>
@ -306,5 +52,39 @@
</handler>
</handlers>
</binding>
<binding id="update" extends="chrome://mozapps/content/shared/richview.xml#richview-item">
<resources>
<stylesheet src="chrome://mozapps/content/update/updates.css"/>
</resources>
<content>
<xul:hbox pack="start">
<xul:label class="update-item-name" xbl:inherits="value=name" crop="right" flex="1"/>
<xul:link class="update-item-details" xbl:inherits="href=url">&details.link;</xul:link>
</xul:hbox>
<xul:label class="update-item-status" xbl:inherits="xbl:text=status" flex="1"/>
</content>
</binding>
<binding id="update-downloading" extends="chrome://mozapps/content/shared/richview.xml#richview-item">
<resources>
<stylesheet src="chrome://mozapps/content/update/updates.css"/>
</resources>
<content>
<xul:hbox pack="start">
<xul:label class="update-item-name" xbl:inherits="value=name" crop="right" flex="1"/>
<xul:link class="update-item-details" xbl:inherits="href=url" label="&details.link;"/>
</xul:hbox>
<xul:progressmeter class="update-item-progress" xbl:inherits="value=progress"/>
<xul:hbox align="center">
<xul:label class="update-item-status" xbl:inherits="value=status" flex="1" crop="right"/>
<xul:button class="update-item-pause" label="&pause.label;" accesskey="&pause.accesskey;"/>
</xul:hbox>
</content>
<implementation>
<field name="eventPrefix">"update-"</field>
</implementation>
</binding>
</bindings>

View File

@ -0,0 +1,140 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is The Update Wizard/Manager.
#
# The Initial Developer of the Original Code is Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Ben Goodger <ben@mozilla.org>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/update/updates.css"?>
<!DOCTYPE wizard [
<!ENTITY % updateDTD SYSTEM "chrome://mozapps/locale/update/updates.dtd">
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%updateDTD;
%brandDTD;
]>
<wizard id="updates"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&updateWizard.title;"
windowtype="Update:Wizard" style="width: 36em;"
onwizardfinished="gUpdates.onFinish();"
onclose="return gUpdates.onClose();">
<script type="application/x-javascript" src="chrome://mozapps/content/update/updates.js"/>
<stringbundleset id="updateSet">
<stringbundle id="brandStrings" src="chrome://branding/locale/brand.properties"/>
<stringbundle id="updateStrings" src="chrome://mozapps/locale/update/updates.properties"/>
</stringbundleset>
<wizardpage id="checking" pageid="checking" next="updatesfound"
onpageshow="gCheckingPage.onPageShow();">
<vbox class="content" flex="1">
<label>&checking.label;</label>
<separator/>
<progressmeter id="checkingProgress" mode="undetermined"/>
<separator flex="1"/>
<hbox pack="end">
<button label="&cancel.label;" accesskey="&cancel.accesskey;"
oncommand="gCheckingPage.onClose();"/>
</hbox>
</vbox>
</wizardpage>
<wizardpage id="updatesfound" pageid="updatesfound" next="downloading"
onpageshow="gUpdatesAvailablePage.onPageShow();" flex="1">
<vbox id="update-info" flex="1">
<vbox id="update-info-inner" flex="1">
<hbox align="start">
<vbox flex="1">
<description id="updateType">
&updateAvailable.placeholder;
</description>
<label id="updateName" crop="right"/>
<description class="updateForMoreInfo">&forMoreInfo.label;
<link id="updateMoreInfoURL">&clickHere.label;</link>.
</description>
</vbox>
<image id="updateImage" src="chrome://branding/content/icon64.png"/>
</hbox>
<separator flex="1"/>
<hbox align="start" id="incompatibleWarning" hidden="true">
<image id="alertImage"/>
<vbox flex="1">
<description>&incompatible.warning;</description>
<hbox pack="end">
<button label="&listIncompatible.label;" accesskey="&listIncompatible.accesskey;"
oncommand="gUpdatesAvailablePage.showIncompatibleItems();"/>
</hbox>
</vbox>
</hbox>
<separator flex="1"/>
<description class="bold">&upgrade.evangelism;</description>
<separator/>
<hbox>
<button label="&later.label;" accesskey="&later.accesskey;"
oncommand="close();"/>
<separator flex="1"/>
<button id="download-button"
label="&download.label;" accesskey="&download.accesskey;"
oncommand="document.documentElement.advance()"/>
</hbox>
</vbox>
</vbox>
<!--
<hbox pack="end">
<resizer dir="bottomright"/>
</hbox>
-->
</wizardpage>
<wizardpage id="downloading" pageid="downloading"
onpageshow="gDownloadingPage.onPageShow();" flex="1">
<label id="downloadingIntro">&downloading.intro;</label>
<view id="updatesView" flex="1"
datasources="rdf:null" persist="last-selected"/>
<hbox id="downloadingFooter">
<checkbox id="showCompletedUpdates"
label="&showCompletedUpdates.label;" accesskey="&showCompletedUpdates.accesskey;"
oncommand="gDownloadingPage.showCompletedUpdatesChanged(event.target);"/>
<separator flex="1"/>
<button label="&close.label;" accesskey="&close.accesskey;" oncommand="close();"/>
</hbox>
</wizardpage>
</wizard>

View File

@ -12,14 +12,14 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Extension Manager.
* The Original Code is the Application Update Service
*
* The Initial Developer of the Original Code is Ben Goodger.
* Portions created by the Initial Developer are Copyright (C) 2004
* The Initial Developer of the Original Code is Google Inc.
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Goodger <ben@bengoodger.com>
* Ben Goodger <ben@mozilla.org>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -35,11 +35,151 @@
*
* ***** END LICENSE BLOCK ***** */
// XXXben - document these files
#include "nsISupports.idl"
interface nsIDOMWindowInternal;
interface nsIRequest;
interface nsIRequestObserver;
[scriptable, uuid(56863a67-bd69-42de-9f40-583e625b457d)]
interface nsIUpdatePatch : nsISupports
{
/**
*
*/
attribute AString type;
/**
*
*/
attribute AString url;
/**
*
*/
attribute AString hashfunction;
/**
*
*/
attribute AString hashvalue;
/**
*
*/
attribute unsigned long size;
};
[scriptable, uuid(bd75a4c6-b813-45b2-a96e-41a429c857c4)]
interface nsIUpdate : nsISupports
{
/**
*
*/
attribute AString type;
/**
*
*/
attribute AString version;
/**
*
*/
attribute AString extensionversion;
/**
*
*/
attribute AString detailsurl;
/**
*
*/
readonly attribute unsigned long patchCount;
/**
*
*/
nsIUpdatePatch getPatchAt(in unsigned long index);
};
[scriptable, uuid(8cbceb6e-8e27-46f2-8808-444c6499f836)]
interface nsIUpdateCheckListener : nsISupports
{
/**
*
*/
void onProgress(in nsIRequest request,
in unsigned long position,
in unsigned long totalSize);
/**
*
*/
void onCheckComplete([array, size_is(updateCount)] in nsIUpdate updates,
in unsigned long updateCount);
/**
*
*/
void onError();
};
[scriptable, uuid(22b00276-ec23-4034-a764-395da539b4be)]
interface nsIUpdatePrompt : nsISupports
{
/**
* Shows a user interface that checks for and then displays the available
* updates.
*/
void checkForUpdates();
/**
* Show a message advising that a set of updates is available for
* download and install.
* @param updates
* An array of available nsIUpdates
* @param updateCount
* The length of |updates|
*/
void showUpdatesAvailable([array, size_is(updateCount)] in nsIUpdate updates,
in unsigned long updateCount);
};
[scriptable, uuid(877ace25-8bc5-452a-8586-9c1cf2871994)]
interface nsIUpdateChecker : nsISupports
{
/**
*
*/
void stopChecking();
};
[scriptable, uuid(9849c4bf-5197-4d22-baa8-e3b44a1703d2)]
interface nsIApplicationUpdateService : nsISupports
{
/**
*
*/
nsIUpdateChecker checkForUpdates(in nsIUpdateCheckListener listener);
/**
* Adds a listener that receives progress and state information about the
* update that is currently being downloaded, e.g. to update a user
* interface.
* @param listener
* An object implementing nsIRequestObserver and optionally
* nsIProgressEventSink that is to be notified of state and
* progress information as the update is downloaded.
*/
void addDownloadListener(in nsIRequestObserver listener);
/**
* Removes a listener that is receiving progress and state information
* about the update that is currently being downloaded.
* @param listener
* The listener object to remove.
*/
void removeDownloadListener(in nsIRequestObserver listener);
/**
*
*/
void downloadUpdate(in nsIUpdate update);
};
/**
* An item managed by the Extension or Software Update System. Contains
@ -111,11 +251,11 @@ interface nsIUpdateItem : nsISupports
/**
* Initializes this Item object.
*/
void init(in AString aID, in AString aVersion,
in AString aInstallLocationKey, in AString aMinAppVersion,
in AString aMaxAppVersion, in AString aName,
in AString aUpdateURL, in AString aIconURL,
in AString aUpdateRDF, in long aType);
void init(in AString id, in AString version,
in AString installLocationKey, in AString minAppVersion,
in AString maxAppVersion, in AString name,
in AString downloadURL, in AString iconURL,
in AString updateURL, in long type);
/**
* Returns a JS Object source representing an nsIUpdateItem.
@ -123,61 +263,6 @@ interface nsIUpdateItem : nsISupports
readonly attribute AString objectSource;
};
[scriptable, uuid(24aee3ca-a274-4247-bd3b-d0acbb5a98aa)]
interface nsIAppUpdateInfoItem : nsISupports
{
readonly attribute AString internalName;
readonly attribute AString name;
readonly attribute AString URL;
readonly attribute AString infoURL;
readonly attribute AString description;
};
[scriptable, uuid(2daab124-9bc7-4c35-bb7b-0fecdea03ce8)]
interface nsIAppUpdateInfo : nsISupports
{
readonly attribute AString updateVersion;
readonly attribute AString updateDisplayVersion;
readonly attribute AString updateInfoURL;
void getCollection(in AString aCollectionName, out unsigned long aItemCount,
[retval, array, size_is(aItemCount)] out nsIAppUpdateInfoItem aItems);
};
[scriptable, uuid(c8a2339e-770a-417d-ab9c-efde1f23ba24)]
interface nsIUpdateService : nsISupports
{
void watchForUpdates();
const unsigned short SOURCE_EVENT_USER = 0x01;
const unsigned short SOURCE_EVENT_BACKGROUND = 0x02;
const unsigned short SOURCE_EVENT_MISMATCH = 0x04;
void checkForUpdates([array, size_is(aItemCount)] in nsIUpdateItem aItems,
in unsigned long aItemCount,
in unsigned short aUpdateTypes,
in unsigned short aSourceEvent,
in nsIDOMWindowInternal aParentWindow);
void checkForUpdatesInternal([array, size_is(aItemCount)] in nsIUpdateItem aItems,
in unsigned long aItemCount,
in unsigned short aUpdateTypes,
in unsigned short aSourceEvent);
readonly attribute long updateCount;
readonly attribute unsigned short updateSeverity;
// these are per-session settings
attribute boolean appUpdatesAvailable;
attribute long extensionUpdatesAvailable;
readonly attribute nsIAppUpdateInfo newestVersion;
readonly attribute nsIAppUpdateInfo currentVersion;
const unsigned short SEVERITY_HIGH = 2;
const unsigned short SEVERITY_MEDIUM = 1;
const unsigned short SEVERITY_LOW = 0;
};
[scriptable, uuid(22d35700-5765-42e1-914b-a0da7c911a8c)]
interface nsIVersionChecker : nsISupports
{

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,186 @@
/* Found Updates */
#foundList {
-moz-appearance: listbox;
margin: 10px 4px 10px 4px;
}
updateitem {
padding-top: 5px;
padding-bottom: 5px;
-moz-padding-start: 5px;
-moz-padding-end: 0px;
border-bottom: 1px dotted #C0C0C0;
margin-bottom: 5px;
}
.warning {
font-weight: bold;
}
.updateItemIcon {
width: 32px;
height: 32px;
max-width: 32px !important;
max-height: 32px !important;
-moz-margin-end: 5px;
}
.updateItemName {
font-weight: bold;
}
.updateItemNameRow {
padding-bottom: 3px;
}
.updateItemURL {
-moz-appearance: none;
border: none;
background-color: Window;
}
.updateItemFromLabel {
padding-top: 2px;
}
.updateItemIcon {
list-style-image: url("chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png");
}
.updateItemChecked {
margin: 20px 0px 3px 0px;
padding: 0px;
}
.updateItemChecked .checkbox-label-box {
display: none;
}
/* Update Wizard */
#alert {
list-style-image: url("chrome://mozapps/skin/update/update.png");
}
/* Inline Update Notifications */
toolbarbutton[type="updates"] {
padding: 0px;
-moz-appearance: none;
border: none;
}
toolbarbutton[type="updates"][updateCount="0"] {
visibility: collapse;
}
toolbarbutton[type="updates"] > .toolbarbutton-icon {
list-style-image: url("chrome://mozapps/skin/update/extensionalert.png");
-moz-image-region: rect(0px 16px 16px 0px);
width: 16px;
height: 16px;
margin: 0px 2px;
}
toolbarbutton[type="updates"][severity="0"] > .toolbarbutton-icon {
-moz-image-region: rect(0px 16px 16px 0px);
}
toolbarbutton[type="updates"][severity="1"] > .toolbarbutton-icon {
-moz-image-region: rect(0px 32px 16px 16px);
}
toolbarbutton[type="updates"][severity="2"] > .toolbarbutton-icon {
-moz-image-region: rect(0px 48px 16px 32px);
}
.throbber {
list-style-image: url("chrome://global/skin/throbber/Throbber-small.gif");
width: 16px;
height: 16px;
margin-top: 5px;
margin-bottom: 5px;
-moz-margin-start: 5px;
-moz-margin-end: 2px;
}
#incompatibleAlert {
background-color: InfoBackground;
color: InfoText;
border: 1px outset InfoBackground;
margin-left: 3px;
margin-right: 3px;
padding: 5px;
}
/* Updates View */
radio[type="update-type"] {
margin: 2px;
-moz-appearance: none;
}
.updateCategoryBox {
background-color: #DFDFDF;
padding: 3px;
-moz-appearance: radio-container;
}
.updateCategoryContent {
padding: 5px;
}
.updateCategoryLabel[selected="true"] {
font-weight: bold;
}
.updateCategoryIcon {
}
radiogroup[type="update-types"] {
-moz-appearance: listbox;
margin: 2px 4px;
border: 2px solid;
-moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
-moz-border-right-colors: ThreeDHighlight ThreeDLightShadow;
-moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow;
-moz-border-left-colors: ThreeDShadow ThreeDDarkShadow;
background-color: -moz-Field;
color: -moz-FieldText;
}
radio[type="update-type"][selected="true"] .updateCategoryBox {
background-color: #C0C0C0;
}
.foundSource {
border-bottom: 1px dotted #000000;
color: #000000;
cursor: pointer;
}
link {
text-decoration: underline !important;
color: #0000FF;
cursor: pointer;
}
link:active {
color: #FF0000;
}
.linkLabel {
cursor: pointer;
}
.updateCategoryContent {
-moz-margin-start: 12px;
}
#optionalItemsList {
-moz-appearance: listbox;
margin: 2px 4px;
border: 2px solid;
-moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
-moz-border-right-colors: ThreeDHighlight ThreeDLightShadow;
-moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow;
-moz-border-left-colors: ThreeDShadow ThreeDDarkShadow;
background-color: -moz-Field;
color: -moz-FieldText;
}

View File

@ -13,6 +13,7 @@ classic.jar:
skin/classic/mozapps/extensions/about.css (extensions/about.css)
skin/classic/mozapps/extensions/actionbuttons.png (extensions/actionbuttons.png)
skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css)
skin/classic/mozapps/extensions/update.css (extensions/update.css)
skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png)
skin/classic/mozapps/plugins/pluginInstallerWizard.css (plugins/pluginInstallerWizard.css)
skin/classic/mozapps/pref/check.gif (pref/check.gif)
@ -27,7 +28,6 @@ classic.jar:
skin/classic/mozapps/shared/viewFader.png (shared/viewFader.png)
skin/classic/mozapps/update/extensionalert.png (update/extensionalert.png)
skin/classic/mozapps/update/icon32.png (update/icon32.png)
skin/classic/mozapps/update/update.css (update/update.css)
skin/classic/mozapps/update/update.png (update/update.png)
skin/classic/mozapps/update/warning.gif (update/warning.gif)
skin/classic/mozapps/xpinstall/xpinstallConfirm.css (xpinstall/xpinstallConfirm.css)