Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // TODO(arv): Now that this is driven by a data model, implement a data model | 5 // TODO(arv): Now that this is driven by a data model, implement a data model |
| 6 // that handles the loading and the events from the bookmark backend. | 6 // that handles the loading and the events from the bookmark backend. |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @typedef {{childIds: Array<string>}} | 9 * @typedef {{childIds: Array<string>}} |
| 10 * | 10 * |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 // Failed to load bookmarks. Most likely due to the bookmark being | 142 // Failed to load bookmarks. Most likely due to the bookmark being |
| 143 // removed. | 143 // removed. |
| 144 cr.dispatchSimpleEvent(this, 'invalidId'); | 144 cr.dispatchSimpleEvent(this, 'invalidId'); |
| 145 return; | 145 return; |
| 146 } | 146 } |
| 147 | 147 |
| 148 this.dataModel = new BookmarksArrayDataModel(items); | 148 this.dataModel = new BookmarksArrayDataModel(items); |
| 149 | 149 |
| 150 this.fixWidth_(); | 150 this.fixWidth_(); |
| 151 cr.dispatchSimpleEvent(this, 'load'); | 151 cr.dispatchSimpleEvent(this, 'load'); |
| 152 chrome.metricsPrivate.recordValue({ | |
| 153 'metricName': 'Bookmarks.BookmarksInFolder', | |
| 154 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LOG, | |
| 155 'min': 0, | |
| 156 'max': 200, | |
|
Dan Beam
2016/11/16 01:26:51
wait, why a max of 200?
Alexei Svitkine (slow)
2016/11/16 01:34:09
Suggest using equivalent of UMA_HISTOGRAM_COUNTS_1
calamity
2016/11/16 01:57:46
Done.
| |
| 157 'buckets': 10 | |
| 158 }, this.dataModel.length); | |
| 159 console.log(this.dataModel.length); | |
|
Dan Beam
2016/11/16 01:26:51
nit: remove the log()
calamity
2016/11/16 01:57:46
Done.
| |
| 152 }, | 160 }, |
| 153 | 161 |
| 154 /** | 162 /** |
| 155 * The bookmark node that the list is currently displaying. If we are | 163 * The bookmark node that the list is currently displaying. If we are |
| 156 * currently displaying search this returns null. | 164 * currently displaying search this returns null. |
| 157 * @type {BookmarkTreeNode} | 165 * @type {BookmarkTreeNode} |
| 158 */ | 166 */ |
| 159 get bookmarkNode() { | 167 get bookmarkNode() { |
| 160 if (this.isSearch()) | 168 if (this.isSearch()) |
| 161 return null; | 169 return null; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 } | 648 } |
| 641 } | 649 } |
| 642 } | 650 } |
| 643 }; | 651 }; |
| 644 | 652 |
| 645 return { | 653 return { |
| 646 BookmarkList: BookmarkList, | 654 BookmarkList: BookmarkList, |
| 647 list: /** @type {Element} */(null), // Set when decorated. | 655 list: /** @type {Element} */(null), // Set when decorated. |
| 648 }; | 656 }; |
| 649 }); | 657 }); |
| OLD | NEW |