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

Unified Diff: ash/common/shelf/shelf_window_watcher_item_delegate.cc

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Address comments. Created 3 years, 9 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
« no previous file with comments | « ash/common/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_window_watcher_item_delegate.cc
diff --git a/ash/common/shelf/shelf_window_watcher_item_delegate.cc b/ash/common/shelf/shelf_window_watcher_item_delegate.cc
index 01f4bd469afc7363230af6b68b7c9a0be0ef21e6..2bac8bbb67192cb627677817ab271f41301ff064 100644
--- a/ash/common/shelf/shelf_window_watcher_item_delegate.cc
+++ b/ash/common/shelf/shelf_window_watcher_item_delegate.cc
@@ -35,42 +35,36 @@ ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(ShelfID id,
ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {}
-ShelfAction ShelfWindowWatcherItemDelegate::ItemSelected(
- ui::EventType event_type,
- int event_flags,
+void ShelfWindowWatcherItemDelegate::ItemSelected(
+ std::unique_ptr<ui::Event> event,
int64_t display_id,
- ShelfLaunchSource source) {
+ ShelfLaunchSource source,
+ const ItemSelectedCallback& callback) {
// Move panels attached on another display to the current display.
if (GetShelfItemType(id_) == TYPE_APP_PANEL &&
window_->aura_window()->GetProperty(kPanelAttachedKey) &&
wm::MoveWindowToDisplay(window_->aura_window(), display_id)) {
window_->Activate();
- return SHELF_ACTION_WINDOW_ACTIVATED;
+ callback.Run(SHELF_ACTION_WINDOW_ACTIVATED, base::nullopt);
+ return;
}
if (window_->IsActive()) {
- if (event_type == ui::ET_KEY_RELEASED) {
+ if (event && event->type() == ui::ET_KEY_RELEASED) {
window_->Animate(::wm::WINDOW_ANIMATION_TYPE_BOUNCE);
- return SHELF_ACTION_NONE;
+ callback.Run(SHELF_ACTION_NONE, base::nullopt);
+ return;
}
window_->Minimize();
- return SHELF_ACTION_WINDOW_MINIMIZED;
+ callback.Run(SHELF_ACTION_WINDOW_MINIMIZED, base::nullopt);
+ return;
}
window_->Activate();
- return SHELF_ACTION_WINDOW_ACTIVATED;
-}
-
-ShelfAppMenuItemList ShelfWindowWatcherItemDelegate::GetAppMenuItems(
- int event_flags) {
- // Return an empty item list to avoid showing an application menu.
- return ShelfAppMenuItemList();
+ callback.Run(SHELF_ACTION_WINDOW_ACTIVATED, base::nullopt);
}
void ShelfWindowWatcherItemDelegate::ExecuteCommand(uint32_t command_id,
- int event_flags) {
- // This delegate does not support showing an application menu.
- NOTIMPLEMENTED();
-}
+ int32_t event_flags) {}
void ShelfWindowWatcherItemDelegate::Close() {
window_->CloseWidget();
« no previous file with comments | « ash/common/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698