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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2867673004: Use OnceCallback on Mojo interfaces in //ash (Closed)
Patch Set: rebase. +#include Created 3 years, 7 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: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 1d969cabbe815ceddc3f6a14f92b2d8bfbd2e6a5..c54d67d88b7b70cdaabb28bdd5b3dac4677eaa41 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -152,9 +152,9 @@ class ShelfItemSelectionTracker : public ShelfItemDelegate {
void ItemSelected(std::unique_ptr<ui::Event> event,
int64_t display_id,
ShelfLaunchSource source,
- const ItemSelectedCallback& callback) override {
+ ItemSelectedCallback callback) override {
item_selected_count_++;
- callback.Run(item_selected_action_, base::nullopt);
+ std::move(callback).Run(item_selected_action_, base::nullopt);
}
void ExecuteCommand(uint32_t command_id, int32_t event_flags) override {}
void Close() override {}
@@ -2007,12 +2007,12 @@ class ListMenuShelfItemDelegate : public ShelfItemDelegate {
void ItemSelected(std::unique_ptr<ui::Event> event,
int64_t display_id,
ShelfLaunchSource source,
- const ItemSelectedCallback& callback) override {
+ ItemSelectedCallback callback) override {
// Two items are needed to show a menu; the data in the items is not tested.
std::vector<mojom::MenuItemPtr> items;
items.push_back(mojom::MenuItem::New());
items.push_back(mojom::MenuItem::New());
- callback.Run(SHELF_ACTION_NONE, std::move(items));
+ std::move(callback).Run(SHELF_ACTION_NONE, std::move(items));
}
void ExecuteCommand(uint32_t command_id, int32_t event_flags) override {}
void Close() override {}

Powered by Google App Engine
This is Rietveld 408576698