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.internet', function() { | 5 cr.define('options.internet', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
8 /** @const */ var IPAddressField = options.internet.IPAddressField; | 8 /** @const */ var IPAddressField = options.internet.IPAddressField; |
9 | 9 |
10 /** | 10 /** |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 * @private | 373 * @private |
374 */ | 374 */ |
375 updateProxyBannerVisibility_: function() { | 375 updateProxyBannerVisibility_: function() { |
376 var bannerDiv = $('info-banner'); | 376 var bannerDiv = $('info-banner'); |
377 // Show banner and determine its message if necessary. | 377 // Show banner and determine its message if necessary. |
378 var controlledBy = $('direct-proxy').controlledBy; | 378 var controlledBy = $('direct-proxy').controlledBy; |
379 if (!controlledBy || controlledBy == '') { | 379 if (!controlledBy || controlledBy == '') { |
380 bannerDiv.hidden = true; | 380 bannerDiv.hidden = true; |
381 } else { | 381 } else { |
382 bannerDiv.hidden = false; | 382 bannerDiv.hidden = false; |
383 // controlledBy must match strings loaded in proxy_handler.cc and | 383 // The possible banner texts are loaded in proxy_handler.cc. |
384 // set in proxy_cros_settings_provider.cc. | 384 var bannerText = 'proxyBanner' + controlledBy.charAt(0).toUpperCase() + |
385 $('banner-text').textContent = loadTimeData.getString(controlledBy); | 385 controlledBy.slice(1); |
| 386 $('banner-text').textContent = loadTimeData.getString(bannerText); |
386 } | 387 } |
387 }, | 388 }, |
388 | 389 |
389 /** | 390 /** |
390 * Handler for when the user clicks on the checkbox to allow a | 391 * Handler for when the user clicks on the checkbox to allow a |
391 * single proxy usage. | 392 * single proxy usage. |
392 * @private | 393 * @private |
393 * @param {Event} e Click Event. | 394 * @param {Event} e Click Event. |
394 */ | 395 */ |
395 toggleSingleProxy_: function(e) { | 396 toggleSingleProxy_: function(e) { |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 | 1018 |
1018 // Don't show page name in address bar and in history to prevent people | 1019 // Don't show page name in address bar and in history to prevent people |
1019 // navigate here by hand and solve issue with page session restore. | 1020 // navigate here by hand and solve issue with page session restore. |
1020 OptionsPage.showPageByName('detailsInternetPage', false); | 1021 OptionsPage.showPageByName('detailsInternetPage', false); |
1021 }; | 1022 }; |
1022 | 1023 |
1023 return { | 1024 return { |
1024 DetailsInternetPage: DetailsInternetPage | 1025 DetailsInternetPage: DetailsInternetPage |
1025 }; | 1026 }; |
1026 }); | 1027 }); |
OLD | NEW |