Skip to content

Commit

Permalink
Empty bookmarks folder display message
Browse files Browse the repository at this point in the history
* if list is empty and modifiable:
   "To bookmark pages, click the star in the address bar"

* if list is empty and unmodifiable:
   "This folder is empty"

Bug: 798653

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I1cd88758158a7c13abe938f4698180916d0e595a
Reviewed-on: https://chromium-review.googlesource.com/878421
Reviewed-by: calamity <calamity@chromium.org>
Commit-Queue: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#538696}
  • Loading branch information
Ayush Khandelwal authored and Commit Bot committed Feb 23, 2018
1 parent 06a2887 commit 70eaf83
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Ashish Kumar Gupta <guptaag@amazon.com>
Ashlin Joseph <ashlin.j@samsung.com>
Attila Dusnoki <dati91@gmail.com>
Avinaash Doreswamy <avi.nitk@samsung.com>
Ayush Khandelwal <k.ayush@samsung.com>
Balazs Kelemen <b.kelemen@samsung.com>
Baul Eun <baul.eun@samsung.com>
Behara Mani Shyam Patro <behara.ms@samsung.com>
Expand Down
3 changes: 3 additions & 0 deletions chrome/app/bookmarks_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@
</message>
<message name="IDS_MD_BOOKMARK_MANAGER_EMPTY_LIST" desc="The message shown when the user has no bookmarks added. 'Star' refers to the icon in the omnibox for adding to bookmarks.">
To bookmark pages, click the star in the address bar
</message>
<message name="IDS_MD_BOOKMARK_MANAGER_EMPTY_UNMODIFIABLE_LIST" desc="The message shown when an unmodifiable bookmark folder is empty.">
This folder is empty
</message>
<message name="IDS_MD_BOOKMARK_MANAGER_FOLDER_LABEL" desc="Label for a folder of bookmarks which is used to label folders for screen reader users.">
Folder
Expand Down
8 changes: 7 additions & 1 deletion chrome/browser/resources/md_bookmarks/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ Polymer({

/** @private */
emptyListMessage_: function() {
const emptyListMessage = this.searchTerm_ ? 'noSearchResults' : 'emptyList';
let emptyListMessage = 'noSearchResults';
if (!this.searchTerm_) {
emptyListMessage = bookmarks.util.canReorderChildren(
this.getState(), this.getState().selectedFolder) ?
'emptyList' :
'emptyUnmodifiableList';
}
return loadTimeData.getString(emptyListMessage);
},

Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) {
AddLocalizedString(source, "editDialogUrlInput",
IDS_BOOKMARK_MANAGER_URL_INPUT_PLACE_HOLDER);
AddLocalizedString(source, "emptyList", IDS_MD_BOOKMARK_MANAGER_EMPTY_LIST);
AddLocalizedString(source, "emptyUnmodifiableList",
IDS_MD_BOOKMARK_MANAGER_EMPTY_UNMODIFIABLE_LIST);
AddLocalizedString(source, "folderLabel",
IDS_MD_BOOKMARK_MANAGER_FOLDER_LABEL);
AddLocalizedString(source, "itemsSelected",
Expand Down

0 comments on commit 70eaf83

Please sign in to comment.