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

Side by Side Diff: chrome/browser/resources/options2/chromeos/network_list.js

Issue 10827141: Move handling of dialog preferences to Preferences class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix my rushed copy & paste :( Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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.network', function() { 5 cr.define('options.network', function() {
6 6
7 var ArrayDataModel = cr.ui.ArrayDataModel; 7 var ArrayDataModel = cr.ui.ArrayDataModel;
8 var List = cr.ui.List; 8 var List = cr.ui.List;
9 var ListItem = cr.ui.ListItem; 9 var ListItem = cr.ui.ListItem;
10 var Menu = cr.ui.Menu; 10 var Menu = cr.ui.Menu;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 var disabled = !UIAccountTweaks.currentUserIsOwner(); 451 var disabled = !UIAccountTweaks.currentUserIsOwner();
452 var entry = {label: loadTimeData.getString(label), 452 var entry = {label: loadTimeData.getString(label),
453 data: {}}; 453 data: {}};
454 if (disabled) { 454 if (disabled) {
455 entry.command = null; 455 entry.command = null;
456 entry.tooltip = 456 entry.tooltip =
457 loadTimeData.getString('dataRoamingDisableToggleTooltip'); 457 loadTimeData.getString('dataRoamingDisableToggleTooltip');
458 } else { 458 } else {
459 entry.command = function() { 459 entry.command = function() {
460 options.Preferences.setBooleanPref( 460 options.Preferences.setBooleanPref(
461 'cros.signed.data_roaming_enabled', 461 'cros.signed.data_roaming_enabled',
James Hawkins 2012/08/02 20:33:32 Optional nit: Condense parameters.
bartfab (slow) 2012/08/31 14:14:30 Done.
462 !enableDataRoaming_); 462 !enableDataRoaming_,
463 true);
463 // Force revalidation of the menu the next time it is 464 // Force revalidation of the menu the next time it is
464 // displayed. 465 // displayed.
465 this.menu_ = null; 466 this.menu_ = null;
466 }; 467 };
467 } 468 }
468 addendum.push(entry); 469 addendum.push(entry);
469 } 470 }
470 var list = this.data.rememberedNetworks; 471 var list = this.data.rememberedNetworks;
471 if (list && list.length > 0) { 472 if (list && list.length > 0) {
472 var callback = function(list) { 473 var callback = function(list) {
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 * Whether the Network list is disabled. Only used for display purpose. 1132 * Whether the Network list is disabled. Only used for display purpose.
1132 * @type {boolean} 1133 * @type {boolean}
1133 */ 1134 */
1134 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR); 1135 cr.defineProperty(NetworkList, 'disabled', cr.PropertyKind.BOOL_ATTR);
1135 1136
1136 // Export 1137 // Export
1137 return { 1138 return {
1138 NetworkList: NetworkList 1139 NetworkList: NetworkList
1139 }; 1140 };
1140 }); 1141 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698