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

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

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: nit 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
« 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 2ab81c86522e339618e0c311cf4295852a8f4b76..2b56a38004a8ebeb08607d8ce27c5f503037a476 100644
--- a/ash/common/shelf/shelf_window_watcher_item_delegate.cc
+++ b/ash/common/shelf/shelf_window_watcher_item_delegate.cc
@@ -10,7 +10,8 @@
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "ash/common/wm_window_property.h"
-#include "ui/events/event.h"
+#include "ash/wm/window_util.h"
+#include "ui/events/event_constants.h"
namespace ash {
@@ -33,26 +34,29 @@ ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(ShelfID id,
ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {}
-ShelfItemDelegate::PerformedAction ShelfWindowWatcherItemDelegate::ItemSelected(
- const ui::Event& event) {
+ShelfAction ShelfWindowWatcherItemDelegate::ItemSelected(
+ ui::EventType event_type,
+ int event_flags,
+ int64_t display_id,
+ ShelfLaunchSource source) {
// Move panels attached on another display to the current display.
if (GetShelfItemType(id_) == TYPE_APP_PANEL &&
window_->GetBoolProperty(WmWindowProperty::PANEL_ATTACHED) &&
- window_->MoveToEventRoot(event)) {
+ wm::MoveWindowToDisplay(window_->aura_window(), display_id)) {
window_->Activate();
- return kExistingWindowActivated;
+ return SHELF_ACTION_WINDOW_ACTIVATED;
}
if (window_->IsActive()) {
- if (event.type() & ui::ET_KEY_RELEASED) {
+ if (event_type == ui::ET_KEY_RELEASED) {
window_->Animate(::wm::WINDOW_ANIMATION_TYPE_BOUNCE);
- return kNoAction;
+ return SHELF_ACTION_NONE;
}
window_->Minimize();
- return kExistingWindowMinimized;
+ return SHELF_ACTION_WINDOW_MINIMIZED;
}
window_->Activate();
- return kExistingWindowActivated;
+ return SHELF_ACTION_WINDOW_ACTIVATED;
}
ShelfAppMenuItemList ShelfWindowWatcherItemDelegate::GetAppMenuItems(
« 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