summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-01 12:59:39 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-04 12:40:43 +0000
commit28b1110370900897ab652cb420c371fab8857ad4 (patch)
tree41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js
parent399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff)
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions. Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js')
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js68
1 files changed, 58 insertions, 10 deletions
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js b/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js
index 491eddeb8be..22c88f89ce4 100644
--- a/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js
@@ -36,7 +36,63 @@ var BrowserChannel = {
};
</if>
+/**
+ * Enumeration of all possible update statuses. The string literals must match
+ * the ones defined at |AboutHandler::UpdateStatusToString|.
+ * @enum {string}
+ */
+var UpdateStatus = {
+ CHECKING: 'checking',
+ UPDATING: 'updating',
+ NEARLY_UPDATED: 'nearly_updated',
+ UPDATED: 'updated',
+ FAILED: 'failed',
+ DISABLED: 'disabled',
+ DISABLED_BY_ADMIN: 'disabled_by_admin',
+};
+
+/**
+ * @typedef {{
+ * status: !UpdateStatus,
+ * progress: (number|undefined),
+ * message: (string|undefined),
+ * }}
+ */
+var UpdateStatusChangedEvent;
+
cr.define('settings', function() {
+ /**
+ * @param {!BrowserChannel} channel
+ * @return {string}
+ */
+ function browserChannelToI18nId(channel) {
+ switch (channel) {
+ case BrowserChannel.BETA: return 'aboutChannelBeta';
+ case BrowserChannel.DEV: return 'aboutChannelDev';
+ case BrowserChannel.STABLE: return 'aboutChannelStable';
+ }
+
+ assertNotReached();
+ }
+
+ /**
+ * @param {!BrowserChannel} currentChannel
+ * @param {!BrowserChannel} targetChannel
+ * @return {boolean} Whether the target channel is more stable than the
+ * current channel.
+ */
+ function isTargetChannelMoreStable(currentChannel, targetChannel) {
+ // List of channels in increasing stability order.
+ var channelList = [
+ BrowserChannel.DEV,
+ BrowserChannel.BETA,
+ BrowserChannel.STABLE,
+ ];
+ var currentIndex = channelList.indexOf(currentChannel);
+ var targetIndex = channelList.indexOf(targetChannel);
+ return currentIndex < targetIndex;
+ }
+
/** @interface */
function AboutPageBrowserProxy() {}
@@ -52,11 +108,6 @@ cr.define('settings', function() {
*/
refreshUpdateStatus: function() {},
- /**
- * Relaunches the browser.
- */
- relaunchNow: function() {},
-
/** Opens the help page. */
openHelpPage: function() {},
@@ -112,11 +163,6 @@ cr.define('settings', function() {
},
/** @override */
- relaunchNow: function() {
- chrome.send('relaunchNow');
- },
-
- /** @override */
openHelpPage: function() {
chrome.send('openHelpPage');
},
@@ -164,5 +210,7 @@ cr.define('settings', function() {
return {
AboutPageBrowserProxy: AboutPageBrowserProxy,
AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl,
+ browserChannelToI18nId: browserChannelToI18nId,
+ isTargetChannelMoreStable: isTargetChannelMoreStable,
};
});