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

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

Issue 2746643002: MD About: controlled indicator for change channel option (Closed)
Patch Set: format Created 3 years, 9 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({
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 /** 53 /**
54 * @param {string} version 54 * @param {string} version
55 * @return {boolean} 55 * @return {boolean}
56 * @private 56 * @private
57 */ 57 */
58 shouldShowVersion_: function(version) { 58 shouldShowVersion_: function(version) {
59 return version.length > 0; 59 return version.length > 0;
60 }, 60 },
61 61
62 /** 62 /**
63 * @param {boolean} canChangeChannel
64 * @return {string}
65 * @private
66 */
67 getChangeChannelIndicatorSourceName_: function(canChangeChannel) {
68 return loadTimeData.getBoolean('aboutEnterpriseManaged') ? '' :
69 loadTimeData.getString('ownerEmail');
70 },
71
72 /**
73 * @param {boolean} canChangeChannel
74 * @return {CrPolicyIndicatorType}
75 * @private
76 */
77 getChangeChannelIndicatorType_: function(canChangeChannel) {
78 if (canChangeChannel)
79 return CrPolicyIndicatorType.NONE;
80 return loadTimeData.getBoolean('aboutEnterpriseManaged') ?
81 CrPolicyIndicatorType.DEVICE_POLICY :
82 CrPolicyIndicatorType.OWNER;
83 },
84
85 /**
63 * @param {!Event} e 86 * @param {!Event} e
64 * @private 87 * @private
65 */ 88 */
66 onChangeChannelTap_: function(e) { 89 onChangeChannelTap_: function(e) {
67 e.preventDefault(); 90 e.preventDefault();
68 this.showChannelSwitcherDialog_ = true; 91 this.showChannelSwitcherDialog_ = true;
69 // Async to wait for dialog to appear in the DOM. 92 // Async to wait for dialog to appear in the DOM.
70 this.async(function() { 93 this.async(function() {
71 var dialog = this.$$('settings-channel-switcher-dialog'); 94 var dialog = this.$$('settings-channel-switcher-dialog');
72 // Register listener to detect when the dialog is closed. Flip the boolean 95 // Register listener to detect when the dialog is closed. Flip the boolean
73 // once closed to force a restamp next time it is shown such that the 96 // once closed to force a restamp next time it is shown such that the
74 // previous dialog's contents are cleared. 97 // previous dialog's contents are cleared.
75 dialog.addEventListener('close', function() { 98 dialog.addEventListener('close', function() {
76 this.showChannelSwitcherDialog_ = false; 99 this.showChannelSwitcherDialog_ = false;
77 this.updateChannelInfo_(); 100 this.updateChannelInfo_();
78 }.bind(this)); 101 }.bind(this));
79 }.bind(this)); 102 }.bind(this));
80 }, 103 },
81 }); 104 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698