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

Side by Side Diff: chrome/browser/resources/settings/pref_tracker/pref_tracker.js

Issue 990473002: Add initial implementation of date-time-settings MD settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing issues Created 5 years, 8 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 2015 The Chromium Authors. All rights reserved. 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 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * `cr-settings-pref-tracker` is a utility element used to track the 7 * `cr-settings-pref-tracker` is a utility element used to track the
8 * initialization of a specified preference and throw an error if the pref 8 * initialization of a specified preference and throw an error if the pref
9 * is not defined after prefs have all been fetched. 9 * is not defined after prefs have all been fetched.
10 * 10 *
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 this.async(function() { 67 this.async(function() {
68 // Note that null == undefined. 68 // Note that null == undefined.
69 if (CrSettingsPrefs.isInitialized && this.pref == null) { 69 if (CrSettingsPrefs.isInitialized && this.pref == null) {
70 // HACK ALERT: This is the best clue we have as to the pref key for 70 // HACK ALERT: This is the best clue we have as to the pref key for
71 // this tracker. This value should not be relied upon anywhere or 71 // this tracker. This value should not be relied upon anywhere or
72 // actually used besides for this error message. 72 // actually used besides for this error message.
73 var keyHint = ''; 73 var keyHint = '';
74 var parentPrefString = this.parentNode && this.parentNode.host && 74 var parentPrefString = this.parentNode && this.parentNode.host &&
75 this.parentNode.host.getAttribute('pref'); 75 this.parentNode.host.getAttribute('pref');
76 if (parentPrefString) { 76 if (parentPrefString) {
77 keyHint = parentPrefString.match(/{{([a-z._]+)}}/)[1]; 77 keyHint = parentPrefString.match(/{{([a-z0-9._]+)}}/)[1];
78 } 78 }
79 79
80 throw new Error('Pref not found. Key Hint: ' + keyHint); 80 throw new Error('Pref not found. Key Hint: ' + keyHint);
81 } 81 }
82 }); 82 });
83 }, 83 },
84 }); 84 });
85 })(); 85 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698