Commit 652781ae authored by Esmael El-Moslimany's avatar Esmael El-Moslimany Committed by Commit Bot

Downloads WebUI: move clear all toast to click handler

The clear all handler from MOJO is invoked each time search is used.
Instead of showing a toast when MOJO clear all is invoked, show the
toast in the clear all button click handler in the toolbar.

Bug: 948651
Change-Id: Ib5f1773bda8d5ffc6abe01a1e0b6f2b26450abf9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549196
Commit-Queue: Dan Beam <dbeam@chromium.org>
Reviewed-by: default avatarDan Beam <dbeam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649002}
parent 7f6d48a7
......@@ -108,6 +108,7 @@ js_library("toolbar") {
":search_service",
"//third_party/polymer/v1_0/components-chromium/iron-a11y-announcer:iron-a11y-announcer-extracted",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/cr_elements/cr_toast:cr_toast_manager",
"//ui/webui/resources/cr_elements/cr_toolbar:cr_toolbar",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:util",
......
......@@ -119,8 +119,6 @@ cr.define('downloads', function() {
/** @private */
clearAll_: function() {
this.set('items_', []);
cr.toastManager.getInstance().show(
loadTimeData.getString('toastClearedAll'), true);
},
/** @private */
......
......@@ -61,6 +61,8 @@ cr.define('downloads', function() {
assert(this.canClearAll());
this.mojoHandler_.clearAll();
this.$.moreActionsMenu.close();
cr.toastManager.getInstance().show(
loadTimeData.getString('toastClearedAll'), true);
},
/** @private */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment