OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 var Preferences = options.Preferences; | 8 var Preferences = options.Preferences; |
9 | 9 |
10 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 handleVisibleChange_: function(e) { | 93 handleVisibleChange_: function(e) { |
94 this.updateControls(); | 94 this.updateControls(); |
95 }, | 95 }, |
96 | 96 |
97 /** | 97 /** |
98 * Updates info banner visibility state. This function shows the banner | 98 * Updates info banner visibility state. This function shows the banner |
99 * if proxy is managed or shared-proxies is off for shared network. | 99 * if proxy is managed or shared-proxies is off for shared network. |
100 * @private | 100 * @private |
101 */ | 101 */ |
102 updateBannerVisibility_: function() { | 102 updateBannerVisibility_: function() { |
103 var bannerDiv = $('info-banner'); | 103 var bannerDiv = $('managed-prefs-banner'); |
104 // Remove class and listener for click event in case they were added | 104 // Remove class and listener for click event in case they were added |
105 // before and updateBannerVisibility_ is called repeatedly. | 105 // before and updateBannerVisibility_ is called repeatedly. |
106 bannerDiv.classList.remove('clickable'); | 106 bannerDiv.classList.remove('clickable'); |
107 bannerDiv.removeEventListener('click', this.handleSharedProxiesHint_); | 107 bannerDiv.removeEventListener('click', this.handleSharedProxiesHint_); |
108 | 108 |
109 // Show banner and determine its message if necessary. | 109 // Show banner and determine its message if necessary. |
110 var controlledBy = $('directProxy').controlledBy; | 110 var controlledBy = $('directProxy').controlledBy; |
111 if (controlledBy == '') { | 111 if (controlledBy == '') { |
112 bannerDiv.hidden = true; | |
113 } else { | |
114 bannerDiv.hidden = false; | 112 bannerDiv.hidden = false; |
115 // controlledBy must match strings loaded in proxy_handler.cc and | 113 // controlledBy must match strings loaded in proxy_handler.cc and |
116 // set in proxy_cros_settings_provider.cc. | 114 // set in proxy_cros_settings_provider.cc. |
117 $('banner-text').textContent = localStrings.getString(controlledBy); | 115 $('banner-text').textContent = localStrings.getString(controlledBy); |
118 if (controlledBy == 'enableSharedProxiesBannerText') { | 116 if (controlledBy == 'enableSharedProxiesBannerText') { |
119 bannerDiv.classList.add('clickable'); | 117 bannerDiv.classList.add('clickable'); |
120 bannerDiv.addEventListener('click', this.handleSharedProxiesHint_); | 118 bannerDiv.addEventListener('click', this.handleSharedProxiesHint_); |
121 } | 119 } |
122 } | 120 } |
123 }, | 121 }, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 ProxyOptions.setNetworkName = function(network) { | 234 ProxyOptions.setNetworkName = function(network) { |
237 ProxyOptions.getInstance().setNetworkName(network); | 235 ProxyOptions.getInstance().setNetworkName(network); |
238 }; | 236 }; |
239 | 237 |
240 // Export | 238 // Export |
241 return { | 239 return { |
242 ProxyOptions: ProxyOptions | 240 ProxyOptions: ProxyOptions |
243 }; | 241 }; |
244 | 242 |
245 }); | 243 }); |
OLD | NEW |