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() { |