Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/resources/settings/about_page/about_page_browser_proxy.js

Issue 1987813004: MD Settings: About page, implementing update status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test, after changing "=" to "$=" Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview A helper object used from the "About" section to interact with 6 * @fileoverview A helper object used from the "About" section to interact with
7 * the browser. 7 * the browser.
8 */ 8 */
9 9
10 <if expr="chromeos"> 10 <if expr="chromeos">
(...skipping 18 matching lines...) Expand all
29 * Enumeration of all possible browser channels. 29 * Enumeration of all possible browser channels.
30 * @enum {string} 30 * @enum {string}
31 */ 31 */
32 var BrowserChannel = { 32 var BrowserChannel = {
33 BETA: 'beta-channel', 33 BETA: 'beta-channel',
34 DEV: 'dev-channel', 34 DEV: 'dev-channel',
35 STABLE: 'stable-channel', 35 STABLE: 'stable-channel',
36 }; 36 };
37 </if> 37 </if>
38 38
39 /**
40 * Enumeration of all possible update statuses. The string literals must match
41 * the ones defined at |AboutHandler::UpdateStatusToString|.
42 * @enum {string}
43 */
44 var UpdateStatus = {
45 CHECKING: 'checking',
46 UPDATING: 'updating',
47 NEARLY_UPDATED: 'nearly_updated',
48 UPDATED: 'updated',
49 FAILED: 'failed',
50 DISABLED: 'disabled',
51 DISABLED_BY_ADMIN: 'disabled_by_admin',
52 };
53
54 /**
55 * @typedef {{
56 * status: !UpdateStatus,
57 * progress: number,
58 * message: string,
59 * }}
60 */
61 var UpdateStatusChangedEvent;
62
39 cr.define('settings', function() { 63 cr.define('settings', function() {
64 /**
65 * @param {!BrowserChannel} channel
66 * @return {string}
67 */
68 function browserChannelToI18nId(channel) {
69 switch (channel) {
70 case BrowserChannel.BETA: return 'aboutChannelBeta';
71 case BrowserChannel.DEV: return 'aboutChannelDev';
72 case BrowserChannel.STABLE: return 'aboutChannelStable';
73 }
74
75 assertNotReached();
76 }
77
40 /** @interface */ 78 /** @interface */
41 function AboutPageBrowserProxy() {} 79 function AboutPageBrowserProxy() {}
42 80
43 AboutPageBrowserProxy.prototype = { 81 AboutPageBrowserProxy.prototype = {
44 /** 82 /**
45 * Indicates to the browser that the page is ready. 83 * Indicates to the browser that the page is ready.
46 */ 84 */
47 pageReady: function() {}, 85 pageReady: function() {},
48 86
49 /** 87 /**
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 /** @override */ 195 /** @override */
158 getRegulatoryInfo: function() { 196 getRegulatoryInfo: function() {
159 return cr.sendWithPromise('getRegulatoryInfo'); 197 return cr.sendWithPromise('getRegulatoryInfo');
160 } 198 }
161 </if> 199 </if>
162 }; 200 };
163 201
164 return { 202 return {
165 AboutPageBrowserProxy: AboutPageBrowserProxy, 203 AboutPageBrowserProxy: AboutPageBrowserProxy,
166 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, 204 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl,
205 browserChannelToI18nId: browserChannelToI18nId,
167 }; 206 };
168 }); 207 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698