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

Side by Side Diff: chrome/browser/resources/settings/prefs/prefs_behavior.js

Issue 1372053002: Flesh out the location-page class to make it more general. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 5 years, 1 month 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview Common prefs behavior.
7 */
8
9 /** @polymerBehavior */
10 var PrefsBehavior = {
11 /**
12 * Gets the pref at the given prefPath. Throws if the pref is not found.
13 * @param {string} prefPath
14 * @return {!chrome.settingsPrivate.PrefObject}
15 * @private
16 */
17 getPref_: function(prefPath) {
18 var pref = /** @type {!chrome.settingsPrivate.PrefObject} */(
19 this.get(prefPath, this.prefs));
20 assert(typeof pref != 'undefined', 'Pref is missing: ' + prefPath);
21 return pref;
22 },
23
24 /**
25 * Sets the value of the pref at the given prefPath.
26 * @param {string} prefPath
27 * @param {*} value
28 * @private
29 */
30 setPrefValue_: function(prefPath, value) {
31 this.set('prefs.' + prefPath + '.value', value);
michaelpg 2015/10/26 22:15:22 call this.getPref_ so the assert runs: setPref
Finnur 2015/10/27 11:30:48 Done.
32 },
33 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698