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

Side by Side Diff: chrome/browser/resources/md_bookmarks/store_client.js

Issue 2858483002: MD Bookmarks: Update a couple of TODOs (Closed)
Patch Set: Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 Defines StoreClient, a Polymer behavior to tie a front-end 6 * @fileoverview Defines StoreClient, a Polymer behavior to tie a front-end
7 * element to back-end data from the store. 7 * element to back-end data from the store.
8 */ 8 */
9 9
10 cr.define('bookmarks', function() { 10 cr.define('bookmarks', function() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 * getter function returns |undefined|, no changes will propagate to the UI. 42 * getter function returns |undefined|, no changes will propagate to the UI.
43 * 43 *
44 * Typechecking is supressed because this conflicts with 44 * Typechecking is supressed because this conflicts with
45 * Object.prototype.watch, which is a Gecko-only method that is recognized 45 * Object.prototype.watch, which is a Gecko-only method that is recognized
46 * by Closure. 46 * by Closure.
47 * @suppress {checkTypes} 47 * @suppress {checkTypes}
48 * @param {string} localProperty 48 * @param {string} localProperty
49 * @param {function(!BookmarksPageState)} valueGetter 49 * @param {function(!BookmarksPageState)} valueGetter
50 */ 50 */
51 watch: function(localProperty, valueGetter) { 51 watch: function(localProperty, valueGetter) {
52 // TODO(tsergeant): Warn if localProperty is not a defined property. 52 if (!this.getPropertyInfo(localProperty).defined) {
tsergeant 2017/05/02 05:09:10 I originally TODO'd this because I thought it woul
calamity 2017/05/02 05:35:59 Heh. Polymer 2.0: Removed APIs - element.getPrope
tsergeant 2017/05/02 05:41:56 😔
53 console.error(
54 'No property ' + localProperty + ' defined on ' + this.is);
55 }
53 this.watches_.push({ 56 this.watches_.push({
54 localProperty: localProperty, 57 localProperty: localProperty,
55 valueGetter: valueGetter, 58 valueGetter: valueGetter,
56 }); 59 });
57 }, 60 },
58 61
59 /** 62 /**
60 * Helper to dispatch an action to the store, which will update the store 63 * Helper to dispatch an action to the store, which will update the store
61 * data and then (possibly) flow through to the UI. 64 * data and then (possibly) flow through to the UI.
62 * @param {Action} action 65 * @param {Action} action
(...skipping 26 matching lines...) Expand all
89 /** @return {!BookmarksPageState} */ 92 /** @return {!BookmarksPageState} */
90 getState: function() { 93 getState: function() {
91 return bookmarks.Store.getInstance().data; 94 return bookmarks.Store.getInstance().data;
92 }, 95 },
93 }; 96 };
94 97
95 return { 98 return {
96 StoreClient: StoreClient, 99 StoreClient: StoreClient,
97 }; 100 };
98 }); 101 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/md_bookmarks/test_store.js » ('j') | chrome/test/data/webui/md_bookmarks/test_store.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698