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

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

Issue 604373006: Compile chrome://settings, part 9: yet another final battle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@K_blockers_from_bookmarks
Patch Set: Created 6 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
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 ///////////////////////////////////////////////////////////////////////////// 7 /////////////////////////////////////////////////////////////////////////////
8 // Preferences class: 8 // Preferences class:
9 9
10 /** 10 /**
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (opt_metric != undefined) argumentList.push(opt_metric); 145 if (opt_metric != undefined) argumentList.push(opt_metric);
146 chrome.send('clearPref', argumentList); 146 chrome.send('clearPref', argumentList);
147 }; 147 };
148 148
149 Preferences.prototype = { 149 Preferences.prototype = {
150 __proto__: cr.EventTarget.prototype, 150 __proto__: cr.EventTarget.prototype,
151 151
152 /** 152 /**
153 * Adds an event listener to the target. 153 * Adds an event listener to the target.
154 * @param {string} type The name of the event. 154 * @param {string} type The name of the event.
155 * @param {!Function|{handleEvent:Function}} handler The handler for the 155 * @param {EventListenerType} handler The handler for the event. This is
156 * event. This is called when the event is dispatched. 156 * called when the event is dispatched.
157 */ 157 */
158 addEventListener: function(type, handler) { 158 addEventListener: function(type, handler) {
159 cr.EventTarget.prototype.addEventListener.call(this, type, handler); 159 cr.EventTarget.prototype.addEventListener.call(this, type, handler);
160 if (!(type in this.registeredPreferences_)) 160 if (!(type in this.registeredPreferences_))
161 this.registeredPreferences_[type] = {}; 161 this.registeredPreferences_[type] = {};
162 }, 162 },
163 163
164 /** 164 /**
165 * Initializes preference reading and change notifications. 165 * Initializes preference reading and change notifications.
166 */ 166 */
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (event.value) 329 if (event.value)
330 prefs.dispatchEvent(event); 330 prefs.dispatchEvent(event);
331 }; 331 };
332 332
333 // Export 333 // Export
334 return { 334 return {
335 Preferences: Preferences 335 Preferences: Preferences
336 }; 336 };
337 337
338 }); 338 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698