| 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 |
| 153 // Use the same histogram configuration as UMA_HISTOGRAM_COUNTS_1000(). |
| 154 chrome.metricsPrivate.recordValue({ |
| 155 'metricName': 'Bookmarks.BookmarksInFolder', |
| 156 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LOG, |
| 157 'min': 1, |
| 158 'max': 1000, |
| 159 'buckets': 50 |
| 160 }, this.dataModel.length); |
| 152 }, | 161 }, |
| 153 | 162 |
| 154 /** | 163 /** |
| 155 * The bookmark node that the list is currently displaying. If we are | 164 * The bookmark node that the list is currently displaying. If we are |
| 156 * currently displaying search this returns null. | 165 * currently displaying search this returns null. |
| 157 * @type {BookmarkTreeNode} | 166 * @type {BookmarkTreeNode} |
| 158 */ | 167 */ |
| 159 get bookmarkNode() { | 168 get bookmarkNode() { |
| 160 if (this.isSearch()) | 169 if (this.isSearch()) |
| 161 return null; | 170 return null; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 } | 649 } |
| 641 } | 650 } |
| 642 } | 651 } |
| 643 }; | 652 }; |
| 644 | 653 |
| 645 return { | 654 return { |
| 646 BookmarkList: BookmarkList, | 655 BookmarkList: BookmarkList, |
| 647 list: /** @type {Element} */(null), // Set when decorated. | 656 list: /** @type {Element} */(null), // Set when decorated. |
| 648 }; | 657 }; |
| 649 }); | 658 }); |
| OLD | NEW |