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

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

Issue 2666033002: [MD Bookmarks] Add edit folder. (Closed)
Patch Set: Test with mockinteractions in list 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_bookmarks/list.js
diff --git a/chrome/browser/resources/md_bookmarks/list.js b/chrome/browser/resources/md_bookmarks/list.js
index 018b9c6d6114c0a618318ee5477fce73d9a6634b..5d16af2d6a3883135262bbe9193dcf7b73b23c02 100644
--- a/chrome/browser/resources/md_bookmarks/list.js
+++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -30,12 +30,10 @@ Polymer({
menu.showAt(/** @type {!Element} */ (e.detail.target));
},
- // TODO(jiaxi): change these dummy click event handlers later.
/** @private */
onEditTap_: function() {
this.closeDropdownMenu_();
- if (this.menuItem_.url)
- this.$.editBookmark.showModal();
+ this.$.editBookmark.showModal();
},
/** @private */
@@ -63,10 +61,11 @@ Polymer({
/** @private */
onSaveEditTap_: function() {
- chrome.bookmarks.update(this.menuItem_.id, {
- 'title': this.menuItem_.title,
- 'url': this.menuItem_.url,
- });
+ var edit = {'title': this.menuItem_.title};
+ if (this.menuItem_.url)
+ edit['url'] = this.menuItem_.url;
+
+ chrome.bookmarks.update(this.menuItem_.id, edit);
this.$.editBookmark.close();
},
@@ -83,6 +82,18 @@ Polymer({
},
/** @private */
+ getEditActionLabel_: function() {
+ var label = this.menuItem_.url ? 'menuEdit' : 'menuRename';
+ return loadTimeData.getString(label);
+ },
+
+ /** @private */
+ getEditorTitle_: function() {
+ var title = this.menuItem_.url ? 'editBookmarkTitle' : 'renameFolderTitle';
+ return loadTimeData.getString(title);
+ },
+
+ /** @private */
emptyListMessage_: function() {
var emptyListMessage = this.searchTerm ? 'noSearchResults' : 'emptyList';
return loadTimeData.getString(emptyListMessage);
« no previous file with comments | « chrome/browser/resources/md_bookmarks/list.html ('k') | chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698