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

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

Issue 11078023: Add controlled setting indicators for content settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 years, 2 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 var Preferences = options.Preferences; 6 var Preferences = options.Preferences;
7 7
8 /** 8 /**
9 * A controlled setting indicator that can be placed on a setting as an 9 * A controlled setting indicator that can be placed on a setting as an
10 * indicator that the value is controlled by some external entity such as 10 * indicator that the value is controlled by some external entity such as
(...skipping 13 matching lines...) Expand all
24 var self = this; 24 var self = this;
25 25
26 // If there is a pref, track its controlledBy and recommendedValue 26 // If there is a pref, track its controlledBy and recommendedValue
27 // properties in order to be able to bring up the correct bubble. 27 // properties in order to be able to bring up the correct bubble.
28 if (this.pref) { 28 if (this.pref) {
29 Preferences.getInstance().addEventListener( 29 Preferences.getInstance().addEventListener(
30 this.pref, this.handlePrefChange.bind(this)); 30 this.pref, this.handlePrefChange.bind(this));
31 this.resetHandler = this.clearAssociatedPref_; 31 this.resetHandler = this.clearAssociatedPref_;
32 } 32 }
33 33
34 this.className = 'controlled-setting-indicator';
34 this.tabIndex = 0; 35 this.tabIndex = 0;
35 this.setAttribute('role', 'button'); 36 this.setAttribute('role', 'button');
36 this.addEventListener('click', this); 37 this.addEventListener('click', this);
37 this.addEventListener('keydown', this); 38 this.addEventListener('keydown', this);
38 this.addEventListener('mousedown', this); 39 this.addEventListener('mousedown', this);
39 }, 40 },
40 41
41 /** 42 /**
42 * The given handler will be called when the user clicks on the 'reset to 43 * The given handler will be called when the user clicks on the 'reset to
43 * recommended value' link shown in the indicator bubble. The |this| object 44 * recommended value' link shown in the indicator bubble. The |this| object
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 * @type {string} 222 * @type {string}
222 */ 223 */
223 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', 224 cr.defineProperty(ControlledSettingIndicator, 'controlledBy',
224 cr.PropertyKind.ATTR); 225 cr.PropertyKind.ATTR);
225 226
226 // Export. 227 // Export.
227 return { 228 return {
228 ControlledSettingIndicator: ControlledSettingIndicator 229 ControlledSettingIndicator: ControlledSettingIndicator
229 }; 230 };
230 }); 231 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/content_settings_exceptions_area.js ('k') | chrome/test/data/policy/policy_test_cases.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698