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

Unified Diff: chrome/browser/resources/md_bookmarks/item.js

Issue 2603303002: [MD Bookmarks] Add UI for Material Bookmarks. (Closed)
Patch Set: Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_bookmarks/item.js
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js
new file mode 100644
index 0000000000000000000000000000000000000000..7c28a1cee25f32bb63fc1a95b119a81c46564f43
--- /dev/null
+++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -0,0 +1,42 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Polymer({
+ is: 'bookmarks-item',
+
+ properties: {
+ /** @type {BookmarkTreeNode} */
+ item: {
+ type: Object,
+ observer: 'onItemChanged_'
+ },
+
+ isFolder_: {
tsergeant 2017/01/03 23:31:17 Use the short form here: isFolder_: Boolean
jiaxi 2017/01/04 02:50:16 Done.
+ type: Boolean,
+ }
+ },
+
+ observers: [
+ 'updateFavicon_(item.url)'
+ ],
+
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onMenuButtonOpenTap_: function(e) {
+ this.fire('toggle-menu', {
+ target: e.target
+ });
+ },
+
+ /** @private */
+ onItemChanged_: function() {
+ this.isFolder_ = !(this.item.url);
+ },
+
+ updateFavicon_: function(url) {
tsergeant 2017/01/03 23:31:17 @private
jiaxi 2017/01/04 02:50:16 Done.
+ this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698