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

Unified Diff: chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc

Issue 14328031: Adding a minimize function for clicks on launcher items if only a single item (already active) is a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added one unit test and addressed comments Created 7 years, 8 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/shell_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
index 51c637f55b6d11bfc7898216483aa935d27ad08d..40efb4fa47272dbf6f7a169e4c3e15acaf25ab88 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
@@ -144,18 +144,18 @@ void ShellWindowLauncherItemController::Clicked(const ui::Event& event) {
// activate it.
if (ash::wm::MoveWindowToEventRoot(panel->GetNativeWindow(), event)) {
if (!panel->GetBaseWindow()->IsActive())
- ShowAndActivate(panel);
+ ShowAndActivateOrMinimize(panel);
} else {
if (panel->GetBaseWindow()->IsActive())
panel->GetBaseWindow()->Minimize();
else
- ShowAndActivate(panel);
+ ShowAndActivateOrMinimize(panel);
}
} else if (launcher_controller()->GetPerAppInterface() ||
shell_windows_.size() == 1) {
ShellWindow* window_to_show = last_active_shell_window_ ?
last_active_shell_window_ : shell_windows_.front();
- ShowAndActivate(window_to_show);
+ ShowAndActivateOrMinimize(window_to_show);
} else {
// TODO(stevenjb): Deprecate
if (!last_active_shell_window_ ||
@@ -169,7 +169,7 @@ void ShellWindowLauncherItemController::Clicked(const ui::Event& event) {
}
}
if (last_active_shell_window_)
- ShowAndActivate(last_active_shell_window_);
+ ShowAndActivateOrMinimize(last_active_shell_window_);
}
}
@@ -178,7 +178,7 @@ void ShellWindowLauncherItemController::ActivateIndexedApp(size_t index) {
return;
ShellWindowList::iterator it = shell_windows_.begin();
std::advance(it, index);
- ShowAndActivate(*it);
+ ShowAndActivateOrMinimize(*it);
}
ChromeLauncherAppMenuItems
@@ -219,9 +219,10 @@ void ShellWindowLauncherItemController::OnWindowPropertyChanged(
}
}
-void ShellWindowLauncherItemController::ShowAndActivate(
+void ShellWindowLauncherItemController::ShowAndActivateOrMinimize(
ShellWindow* shell_window) {
- // Always activate windows when shown from the launcher.
- shell_window->GetBaseWindow()->Show();
- shell_window->GetBaseWindow()->Activate();
+ // Either show or minimize windows when shown from the launcher.
+ launcher_controller()->ActivateWindowOrMinimizeIfActive(
+ shell_window->GetBaseWindow(),
+ GetApplicationList().size() == 2);
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698