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

Side by Side Diff: chrome/browser/resources/settings/about_page/update_warning_dialog.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 'settings-update-warning-dialog' is a component warning the 6 * @fileoverview 'settings-update-warning-dialog' is a component warning the
7 * user about update over mobile data. By clicking 'Continue', the user 7 * user about update over mobile data. By clicking 'Continue', the user
8 * agrees to download update using mobile data. 8 * agrees to download update using mobile data.
9 */ 9 */
10 Polymer({ 10 Polymer({
11 is: 'settings-update-warning-dialog', 11 is: 'settings-update-warning-dialog',
12 12
13 behaviors: [I18nBehavior], 13 behaviors: [I18nBehavior],
14 14
15 properties: {
16 /** @type {!AboutPageUpdateInfo|undefined} */
17 updateInfo: {
18 type: Object,
19 observer: 'updateInfoChanged_',
20 },
21 },
22
23 /** @private {?settings.AboutPageBrowserProxy} */
24 browserProxy_: null,
25
15 /** @override */ 26 /** @override */
16 ready: function() { 27 ready: function() {
17 this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance(); 28 this.browserProxy_ = settings.AboutPageBrowserProxyImpl.getInstance();
18 }, 29 },
19 30
20 /** @override */ 31 /** @override */
21 attached: function() { 32 attached: function() {
22 this.$.dialog.showModal(); 33 this.$.dialog.showModal();
23 }, 34 },
24 35
25 /** @private */ 36 /** @private */
26 onCancelTap_: function() { 37 onCancelTap_: function() {
27 // TODO(weidongg): implement the real behaviors here.
28 this.$.dialog.close(); 38 this.$.dialog.close();
29 }, 39 },
30 40
31 /** @private */ 41 /** @private */
32 onContinueTap_: function() { 42 onContinueTap_: function() {
33 // TODO(weidongg): implement the real behaviors here. 43 this.browserProxy_.requestUpdateOverCellular(this.updateInfo.version,
44 this.updateInfo.size);
34 this.$.dialog.close(); 45 this.$.dialog.close();
35 }, 46 },
36 47
37 /** 48 /** @private */
38 * @param {string} updateSizeMb Size of the update in megabytes. 49 updateInfoChanged_: function() {
39 * @private 50 this.$$("#update-warning-message").innerHTML =
40 */ 51 this.i18n("aboutUpdateWarningMessage",
41 setUpdateWarningMessage: function(updateSizeMb) { 52 // Convert bytes to megabytes
42 this.$$("#update-warning-message").innerHTML = 53 Math.floor(Number(this.updateInfo.size) / (1024 * 1024)));
43 this.i18n("aboutUpdateWarningMessage", updateSizeMb);
44 }, 54 },
45 }); 55 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/about_page/about_page_browser_proxy.js ('k') | chrome/browser/ui/webui/help/help_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698