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

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

Issue 2873193002: Make update over cellular an option for user (Closed)
Patch Set: Put code in CHROME_OS wrapper to fix trybot error Created 3 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 17 matching lines...) Expand all
28 /** 28 /**
29 * @typedef {{ 29 * @typedef {{
30 * arcVersion: string, 30 * arcVersion: string,
31 * osFirmware: string, 31 * osFirmware: string,
32 * osVersion: string, 32 * osVersion: string,
33 * }} 33 * }}
34 */ 34 */
35 var VersionInfo; 35 var VersionInfo;
36 36
37 /** 37 /**
38 * @typedef {{
39 * version: (string|undefined),
40 * size: (string|undefined),
41 * }}
42 */
43 var AboutPageUpdateInfo;
44
45 /**
38 * Enumeration of all possible browser channels. 46 * Enumeration of all possible browser channels.
39 * @enum {string} 47 * @enum {string}
40 */ 48 */
41 var BrowserChannel = { 49 var BrowserChannel = {
42 BETA: 'beta-channel', 50 BETA: 'beta-channel',
43 DEV: 'dev-channel', 51 DEV: 'dev-channel',
44 STABLE: 'stable-channel', 52 STABLE: 'stable-channel',
45 }; 53 };
46 // </if> 54 // </if>
47 55
48 /** 56 /**
49 * Enumeration of all possible update statuses. The string literals must match 57 * Enumeration of all possible update statuses. The string literals must match
50 * the ones defined at |AboutHandler::UpdateStatusToString|. 58 * the ones defined at |AboutHandler::UpdateStatusToString|.
51 * @enum {string} 59 * @enum {string}
52 */ 60 */
53 var UpdateStatus = { 61 var UpdateStatus = {
54 CHECKING: 'checking', 62 CHECKING: 'checking',
55 UPDATING: 'updating', 63 UPDATING: 'updating',
56 NEARLY_UPDATED: 'nearly_updated', 64 NEARLY_UPDATED: 'nearly_updated',
57 UPDATED: 'updated', 65 UPDATED: 'updated',
58 FAILED: 'failed', 66 FAILED: 'failed',
59 DISABLED: 'disabled', 67 DISABLED: 'disabled',
60 DISABLED_BY_ADMIN: 'disabled_by_admin', 68 DISABLED_BY_ADMIN: 'disabled_by_admin',
69 NEED_PERMISSION_TO_UPDATE: 'need_permission_to_update',
61 }; 70 };
62 71
63 // <if expr="_google_chrome and is_macosx"> 72 // <if expr="_google_chrome and is_macosx">
64 /** 73 /**
65 * @typedef {{ 74 * @typedef {{
66 * hidden: boolean, 75 * hidden: boolean,
67 * disabled: boolean, 76 * disabled: boolean,
68 * actionable: boolean, 77 * actionable: boolean,
69 * text: (string|undefined) 78 * text: (string|undefined)
70 * }} 79 * }}
71 */ 80 */
72 var PromoteUpdaterStatus; 81 var PromoteUpdaterStatus;
73 // </if> 82 // </if>
74 83
75 /** 84 /**
76 * @typedef {{ 85 * @typedef {{
77 * status: !UpdateStatus, 86 * status: !UpdateStatus,
78 * progress: (number|undefined), 87 * progress: (number|undefined),
79 * message: (string|undefined), 88 * message: (string|undefined),
80 * connectionTypes: (string|undefined), 89 * connectionTypes: (string|undefined),
90 * version: (string|undefined),
91 * size: (string|undefined),
81 * }} 92 * }}
82 */ 93 */
83 var UpdateStatusChangedEvent; 94 var UpdateStatusChangedEvent;
84 95
85 cr.define('settings', function() { 96 cr.define('settings', function() {
86 /** 97 /**
87 * @param {!BrowserChannel} channel 98 * @param {!BrowserChannel} channel
88 * @return {string} 99 * @return {string}
89 */ 100 */
90 function browserChannelToI18nId(channel) { 101 function browserChannelToI18nId(channel) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 openFeedbackDialog: function() {}, 151 openFeedbackDialog: function() {},
141 // </if> 152 // </if>
142 153
143 // <if expr="chromeos"> 154 // <if expr="chromeos">
144 /** 155 /**
145 * Checks for available update and applies if it exists. 156 * Checks for available update and applies if it exists.
146 */ 157 */
147 requestUpdate: function() {}, 158 requestUpdate: function() {},
148 159
149 /** 160 /**
161 * Checks for the update with specified version and size and applies over
162 * cellular. The target version and size are the same as were received from
163 * 'update-status-changed' WebUI event. We send this back all the way to
164 * update engine for it to double check with update server in case there's a
165 * new update available. This prevents downloading the new update that user
166 * didn't agree to.
167 * @param {string} target_version
168 * @param {string} target_size
169 */
170 requestUpdateOverCellular: function(target_version, target_size) {},
171
172 /**
150 * @param {!BrowserChannel} channel 173 * @param {!BrowserChannel} channel
151 * @param {boolean} isPowerwashAllowed 174 * @param {boolean} isPowerwashAllowed
152 */ 175 */
153 setChannel: function(channel, isPowerwashAllowed) {}, 176 setChannel: function(channel, isPowerwashAllowed) {},
154 177
155 /** @return {!Promise<!ChannelInfo>} */ 178 /** @return {!Promise<!ChannelInfo>} */
156 getChannelInfo: function() {}, 179 getChannelInfo: function() {},
157 180
158 /** @return {!Promise<!VersionInfo>} */ 181 /** @return {!Promise<!VersionInfo>} */
159 getVersionInfo: function() {}, 182 getVersionInfo: function() {},
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 }, 230 },
208 // </if> 231 // </if>
209 232
210 // <if expr="chromeos"> 233 // <if expr="chromeos">
211 /** @override */ 234 /** @override */
212 requestUpdate: function() { 235 requestUpdate: function() {
213 chrome.send('requestUpdate'); 236 chrome.send('requestUpdate');
214 }, 237 },
215 238
216 /** @override */ 239 /** @override */
240 requestUpdateOverCellular: function(target_version, target_size) {
241 chrome.send('requestUpdateOverCellular', [target_version, target_size]);
242 },
243
244 /** @override */
217 setChannel: function(channel, isPowerwashAllowed) { 245 setChannel: function(channel, isPowerwashAllowed) {
218 chrome.send('setChannel', [channel, isPowerwashAllowed]); 246 chrome.send('setChannel', [channel, isPowerwashAllowed]);
219 }, 247 },
220 248
221 /** @override */ 249 /** @override */
222 getChannelInfo: function() { 250 getChannelInfo: function() {
223 return cr.sendWithPromise('getChannelInfo'); 251 return cr.sendWithPromise('getChannelInfo');
224 }, 252 },
225 253
226 /** @override */ 254 /** @override */
227 getVersionInfo: function() { 255 getVersionInfo: function() {
228 return cr.sendWithPromise('getVersionInfo'); 256 return cr.sendWithPromise('getVersionInfo');
229 }, 257 },
230 258
231 /** @override */ 259 /** @override */
232 getRegulatoryInfo: function() { 260 getRegulatoryInfo: function() {
233 return cr.sendWithPromise('getRegulatoryInfo'); 261 return cr.sendWithPromise('getRegulatoryInfo');
234 } 262 }
235 // </if> 263 // </if>
236 }; 264 };
237 265
238 return { 266 return {
239 AboutPageBrowserProxy: AboutPageBrowserProxy, 267 AboutPageBrowserProxy: AboutPageBrowserProxy,
240 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, 268 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl,
241 browserChannelToI18nId: browserChannelToI18nId, 269 browserChannelToI18nId: browserChannelToI18nId,
242 isTargetChannelMoreStable: isTargetChannelMoreStable, 270 isTargetChannelMoreStable: isTargetChannelMoreStable,
243 }; 271 };
244 }); 272 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698