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

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

Issue 2813503002: MD Bookmarks: Prevent navigating to invalid folders (Closed)
Patch Set: Add positive test case Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'bookmarks-item', 6 is: 'bookmarks-item',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 this.dispatch(bookmarks.actions.selectItem( 90 this.dispatch(bookmarks.actions.selectItem(
91 this.itemId, e.ctrlKey, e.shiftKey, this.getState())); 91 this.itemId, e.ctrlKey, e.shiftKey, this.getState()));
92 e.stopPropagation(); 92 e.stopPropagation();
93 }, 93 },
94 94
95 /** 95 /**
96 * @param {Event} e 96 * @param {Event} e
97 * @private 97 * @private
98 */ 98 */
99 onDblClick_: function(e) { 99 onDblClick_: function(e) {
100 if (!this.item_.url) 100 if (!this.item_.url) {
101 this.dispatch(bookmarks.actions.selectFolder(this.item_.id)); 101 this.dispatch(
102 else 102 bookmarks.actions.selectFolder(this.item_.id, this.getState().nodes));
103 } else {
103 chrome.tabs.create({url: this.item_.url}); 104 chrome.tabs.create({url: this.item_.url});
105 }
104 }, 106 },
105 107
106 /** 108 /**
107 * @param {string} url 109 * @param {string} url
108 * @private 110 * @private
109 */ 111 */
110 updateFavicon_: function(url) { 112 updateFavicon_: function(url) {
111 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); 113 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url);
112 }, 114 },
113 }); 115 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698