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

Unified Diff: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.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
Index: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
index 6670fe49821920dc89a7458614cb5528f5ebb9b5..631e530a956c586a13f9f3e7f2febe717d68d11e 100644
--- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
@@ -69,31 +69,25 @@ void AppWindowLauncherItemController::SetActiveWindow(aura::Window* window) {
last_active_window_ = app_window;
}
-ash::ShelfItemDelegate::PerformedAction
-AppWindowLauncherItemController::Activate(ash::LaunchSource source) {
- DCHECK(!windows_.empty());
- ui::BaseWindow* window_to_activate =
- last_active_window_ ? last_active_window_ : windows_.back();
- window_to_activate->Activate();
- return kExistingWindowActivated;
-}
-
AppWindowLauncherItemController*
AppWindowLauncherItemController::AsAppWindowLauncherItemController() {
return this;
}
-ash::ShelfItemDelegate::PerformedAction
-AppWindowLauncherItemController::ItemSelected(const ui::Event& event) {
+ash::ShelfAction AppWindowLauncherItemController::ItemSelected(
+ ui::EventType event_type,
+ int event_flags,
+ int64_t display_id,
+ ash::ShelfLaunchSource source) {
if (windows_.empty())
- return kNoAction;
+ return ash::SHELF_ACTION_NONE;
ui::BaseWindow* window_to_show =
last_active_window_ ? last_active_window_ : windows_.front();
// If the event was triggered by a keystroke, we try to advance to the next
// item if the window we are trying to activate is already active.
if (windows_.size() >= 1 && window_to_show->IsActive() &&
- event.type() == ui::ET_KEY_RELEASED) {
+ event_type == ui::ET_KEY_RELEASED) {
return ActivateOrAdvanceToNextAppWindow(window_to_show);
}
@@ -137,15 +131,14 @@ void AppWindowLauncherItemController::OnWindowPropertyChanged(
}
}
-ash::ShelfItemDelegate::PerformedAction
-AppWindowLauncherItemController::ShowAndActivateOrMinimize(
+ash::ShelfAction AppWindowLauncherItemController::ShowAndActivateOrMinimize(
ui::BaseWindow* app_window) {
// Either show or minimize windows when shown from the launcher.
return launcher_controller()->ActivateWindowOrMinimizeIfActive(
app_window, GetAppMenuItems(0).size() == 1);
}
-ash::ShelfItemDelegate::PerformedAction
+ash::ShelfAction
AppWindowLauncherItemController::ActivateOrAdvanceToNextAppWindow(
ui::BaseWindow* window_to_show) {
WindowList::iterator i(
@@ -164,5 +157,5 @@ AppWindowLauncherItemController::ActivateOrAdvanceToNextAppWindow(
} else {
return ShowAndActivateOrMinimize(window_to_show);
}
- return kNoAction;
+ return ash::SHELF_ACTION_NONE;
}

Powered by Google App Engine
This is Rietveld 408576698