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

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

Issue 2011703002: MD Settings: About page, hooking up channel switcher dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_regulatory_info
Patch Set: Nit. Created 4 years, 6 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 'settings-detailed-build-info' contains detailed build 6 * @fileoverview 'settings-detailed-build-info' contains detailed build
7 * information for ChromeOS. 7 * information for ChromeOS.
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
11 is: 'settings-detailed-build-info', 11 is: 'settings-detailed-build-info',
12 12
13 behaviors: [I18nBehavior], 13 behaviors: [I18nBehavior],
14 14
15 properties: { 15 properties: {
16 /** @private {!VersionInfo} */ 16 /** @private {!VersionInfo} */
17 versionInfo_: Object, 17 versionInfo_: Object,
18 18
19 /** @private */ 19 /** @private */
20 currentlyOnChannelText_: String, 20 currentlyOnChannelText_: String,
21
22 /** @private */
23 showChannelSwitcherDialog_: Boolean,
24
25 /** @private */
26 canChangeChannel_: {
27 type: Boolean,
28 value: function() {
29 return loadTimeData.getBoolean('aboutCanChangeChannel');
30 },
31 },
21 }, 32 },
22 33
23 /** @override */ 34 /** @override */
24 ready: function() { 35 ready: function() {
25 var browserProxy = settings.AboutPageBrowserProxyImpl.getInstance(); 36 var browserProxy = settings.AboutPageBrowserProxyImpl.getInstance();
26 browserProxy.pageReady(); 37 browserProxy.pageReady();
27 38
28 browserProxy.getVersionInfo().then(function(versionInfo) { 39 browserProxy.getVersionInfo().then(function(versionInfo) {
29 this.versionInfo_ = versionInfo; 40 this.versionInfo_ = versionInfo;
30 }.bind(this)); 41 }.bind(this));
31 browserProxy.getCurrentChannel().then(function(channel) { 42 browserProxy.getCurrentChannel().then(function(channel) {
32 this.currentlyOnChannelText_ = this.i18n( 43 this.currentlyOnChannelText_ = this.i18n(
33 'aboutCurrentlyOnChannel', 44 'aboutCurrentlyOnChannel',
34 this.i18n(settings.browserChannelToI18nId(channel))); 45 this.i18n(settings.browserChannelToI18nId(channel)));
35 }.bind(this)); 46 }.bind(this));
36 }, 47 },
37 48
38 /** 49 /**
39 * @param {string} version 50 * @param {string} version
40 * @return {boolean} 51 * @return {boolean}
41 * @private 52 * @private
42 */ 53 */
43 shouldShowVersion_: function(version) { 54 shouldShowVersion_: function(version) {
44 return version.length > 0; 55 return version.length > 0;
45 }, 56 },
57
58 /** @private */
59 onChangeChannelTap_: function() {
60 this.showChannelSwitcherDialog_ = true;
61 this.async(function() {
dschuyler 2016/05/27 22:16:21 Please add a comment above this.async to explain w
dpapad 2016/05/27 23:32:18 Done.
62 var dialog = this.$$('settings-channel-switcher-dialog');
63 // Register listener to detect when the dialog is closed. Flip the boolean
64 // once closed to force a restamp next time it is shown such that the
65 // previous dialog's contents are cleared.
66 dialog.addEventListener('iron-overlay-closed', function() {
67 this.showChannelSwitcherDialog_ = false;
68 }.bind(this));
69 }.bind(this));
70 },
46 }); 71 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698