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

Side by Side Diff: chrome/browser/resources/options/pref_ui.js

Issue 215423002: [Hotword] Make ConfirmDialog subclass from SettingsDialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove comment Created 6 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 | 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', function() { 5 cr.define('options', function() {
6 6
7 var Preferences = options.Preferences; 7 var Preferences = options.Preferences;
8 8
9 /** 9 /**
10 * Allows an element to be disabled for several reasons. 10 * Allows an element to be disabled for several reasons.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 PrefCheckbox.prototype = { 153 PrefCheckbox.prototype = {
154 // Set up the prototype chain 154 // Set up the prototype chain
155 __proto__: PrefInputElement.prototype, 155 __proto__: PrefInputElement.prototype,
156 156
157 /** 157 /**
158 * Initialization function for the cr.ui framework. 158 * Initialization function for the cr.ui framework.
159 */ 159 */
160 decorate: function() { 160 decorate: function() {
161 PrefInputElement.prototype.decorate.call(this); 161 PrefInputElement.prototype.decorate.call(this);
162 this.type = 'checkbox'; 162 this.type = 'checkbox';
163
164 if (this.dialogPref)
165 this.updatePrefFromState_();
163 }, 166 },
164 167
165 /** 168 /**
166 * Update the associated pref when when the user makes changes to the 169 * Update the associated pref when when the user makes changes to the
167 * checkbox state. 170 * checkbox state.
168 * @private 171 * @private
169 */ 172 */
170 updatePrefFromState_: function() { 173 updatePrefFromState_: function() {
171 var value = this.inverted_pref ? !this.checked : this.checked; 174 var value = this.inverted_pref ? !this.checked : this.checked;
172 Preferences.setBooleanPref(this.pref, value, 175 Preferences.setBooleanPref(this.pref, value,
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 PrefNumber: PrefNumber, 551 PrefNumber: PrefNumber,
549 PrefRadio: PrefRadio, 552 PrefRadio: PrefRadio,
550 PrefRange: PrefRange, 553 PrefRange: PrefRange,
551 PrefSelect: PrefSelect, 554 PrefSelect: PrefSelect,
552 PrefTextField: PrefTextField, 555 PrefTextField: PrefTextField,
553 PrefPortNumber: PrefPortNumber, 556 PrefPortNumber: PrefPortNumber,
554 PrefButton: PrefButton 557 PrefButton: PrefButton
555 }; 558 };
556 559
557 }); 560 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/hotword_confirm_overlay.html ('k') | chrome/browser/resources/options/preferences.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698