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

Unified Diff: chrome/browser/ui/ash/launcher/app_shortcut_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 bounce animation in case of no minimize 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/app_shortcut_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
index 50751c3ea06f2a2925d01dfe3c22594b0fc1be58..3fd33fd9b7dd5f62fed6165c54823c645f12d837 100644
--- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
@@ -88,9 +88,13 @@ void AppShortcutLauncherItemController::Activate() {
TabStripModel* tab_strip = browser->tab_strip_model();
int index = tab_strip->GetIndexOfWebContents(content);
DCHECK_NE(TabStripModel::kNoTab, index);
- tab_strip->ActivateTabAt(index, false);
- browser->window()->Show();
- ash::wm::ActivateWindow(browser->window()->GetNativeWindow());
+
+ int old_index = tab_strip->active_index();
+ if (index != old_index)
+ tab_strip->ActivateTabAt(index, false);
+ app_controller_->ActivateWindowOrMinimizeIfActive(
+ browser->window(),
+ index == old_index && GetRunningApplications().size() == 1);
}
void AppShortcutLauncherItemController::Close() {

Powered by Google App Engine
This is Rietveld 408576698