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

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

Issue 2675503002: [MD Bookmarks] Remove Multiple Selected Items. (Closed)
Patch Set: add test Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/store.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-list', 6 is: 'bookmarks-list',
7 7
8 properties: { 8 properties: {
9 /** @type {BookmarkTreeNode} */ 9 /** @type {BookmarkTreeNode} */
10 menuItem_: Object, 10 menuItem_: Object,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 onCopyURLTap_: function() { 42 onCopyURLTap_: function() {
43 var idList = [this.menuItem_.id]; 43 var idList = [this.menuItem_.id];
44 chrome.bookmarkManagerPrivate.copy(idList, function() { 44 chrome.bookmarkManagerPrivate.copy(idList, function() {
45 // TODO(jiaxi): Add toast later. 45 // TODO(jiaxi): Add toast later.
46 }); 46 });
47 this.closeDropdownMenu_(); 47 this.closeDropdownMenu_();
48 }, 48 },
49 49
50 /** @private */ 50 /** @private */
51 onDeleteTap_: function() { 51 onDeleteTap_: function() {
52 if (this.menuItem_.url) { 52 this.fire('remove-item', this.menuItem_);
53 chrome.bookmarks.remove(this.menuItem_.id, function() {
54 // TODO(jiaxi): Add toast later.
55 }.bind(this));
56 } else {
57 chrome.bookmarks.removeTree(this.menuItem_.id, function() {
58 // TODO(jiaxi): Add toast later.
59 }.bind(this));
60 }
61 this.closeDropdownMenu_(); 53 this.closeDropdownMenu_();
62 }, 54 },
63 55
64 /** @private */ 56 /** @private */
65 onSaveEditTap_: function() { 57 onSaveEditTap_: function() {
66 chrome.bookmarks.update(this.menuItem_.id, { 58 chrome.bookmarks.update(this.menuItem_.id, {
67 'title': this.menuItem_.title, 59 'title': this.menuItem_.title,
68 'url': this.menuItem_.url, 60 'url': this.menuItem_.url,
69 }); 61 });
70 this.$.editBookmark.close(); 62 this.$.editBookmark.close();
(...skipping 15 matching lines...) Expand all
86 emptyListMessage_: function() { 78 emptyListMessage_: function() {
87 var emptyListMessage = this.searchTerm ? 'noSearchResults' : 'emptyList'; 79 var emptyListMessage = this.searchTerm ? 'noSearchResults' : 'emptyList';
88 return loadTimeData.getString(emptyListMessage); 80 return loadTimeData.getString(emptyListMessage);
89 }, 81 },
90 82
91 /** @private */ 83 /** @private */
92 isEmptyList_: function() { 84 isEmptyList_: function() {
93 return this.displayedList.length == 0; 85 return this.displayedList.length == 0;
94 }, 86 },
95 }); 87 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698