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

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

Issue 7322014: Autofill button should get enabled and disabled according to the policy value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One last tiny cleanup. Created 9 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 8
9 // State variables. 9 // State variables.
10 var syncEnabled = false; 10 var syncEnabled = false;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 if (PersonalOptions.disableAutofillManagement()) { 119 if (PersonalOptions.disableAutofillManagement()) {
120 $('autofill-settings').disabled = true; 120 $('autofill-settings').disabled = true;
121 121
122 // Disable and turn off autofill. 122 // Disable and turn off autofill.
123 var autofillEnabled = $('autofill-enabled'); 123 var autofillEnabled = $('autofill-enabled');
124 autofillEnabled.disabled = true; 124 autofillEnabled.disabled = true;
125 autofillEnabled.checked = false; 125 autofillEnabled.checked = false;
126 cr.dispatchSimpleEvent(autofillEnabled, 'change'); 126 cr.dispatchSimpleEvent(autofillEnabled, 'change');
127 } else {
128 Preferences.getInstance().addEventListener(
129 'autofill.enabled',
130 function(event) {
131 var managed = event.value && event.value['managed'];
132 var value = event.value && event.value['value'] != undefined ?
133 event.value['value'] : event.value;
134 $('autofill-settings').disabled = managed && !value;
135 });
127 } 136 }
128 }, 137 },
129 138
130 setSyncEnabled_: function(enabled) { 139 setSyncEnabled_: function(enabled) {
131 this.syncEnabled = enabled; 140 this.syncEnabled = enabled;
132 }, 141 },
133 142
134 setSyncSetupCompleted_: function(completed) { 143 setSyncSetupCompleted_: function(completed) {
135 this.syncSetupCompleted = completed; 144 this.syncSetupCompleted = completed;
136 $('customize-sync').hidden = !completed; 145 $('customize-sync').hidden = !completed;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 PersonalOptions.getInstance()[name + '_'](value); 270 PersonalOptions.getInstance()[name + '_'](value);
262 }; 271 };
263 }); 272 });
264 273
265 // Export 274 // Export
266 return { 275 return {
267 PersonalOptions: PersonalOptions 276 PersonalOptions: PersonalOptions
268 }; 277 };
269 278
270 }); 279 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698