| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h" | 5 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 105 } |
| 106 | 106 |
| 107 // static | 107 // static |
| 108 void LauncherIconUpdater::ActivateByID(ash::LauncherID id) { | 108 void LauncherIconUpdater::ActivateByID(ash::LauncherID id) { |
| 109 TabContentsWrapper* tab = NULL; | 109 TabContentsWrapper* tab = NULL; |
| 110 const LauncherIconUpdater* updater = GetLauncherByID(id, &tab); | 110 const LauncherIconUpdater* updater = GetLauncherByID(id, &tab); |
| 111 if (!updater) { | 111 if (!updater) { |
| 112 NOTREACHED(); | 112 NOTREACHED(); |
| 113 return; | 113 return; |
| 114 } | 114 } |
| 115 updater->window_->Show(); |
| 115 ash::ActivateWindow(updater->window_); | 116 ash::ActivateWindow(updater->window_); |
| 116 if (tab) { | 117 if (tab) { |
| 117 updater->tab_model_->ActivateTabAt( | 118 updater->tab_model_->ActivateTabAt( |
| 118 updater->tab_model_->GetIndexOfTabContents(tab), true); | 119 updater->tab_model_->GetIndexOfTabContents(tab), true); |
| 119 } | 120 } |
| 120 } | 121 } |
| 121 | 122 |
| 122 // static | 123 // static |
| 123 string16 LauncherIconUpdater::GetTitleByID(ash::LauncherID id) { | 124 string16 LauncherIconUpdater::GetTitleByID(ash::LauncherID id) { |
| 124 TabContentsWrapper* tab = NULL; | 125 TabContentsWrapper* tab = NULL; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 return true; | 393 return true; |
| 393 for (AppTabMap::const_iterator i = app_map_.begin(); i != app_map_.end(); | 394 for (AppTabMap::const_iterator i = app_map_.begin(); i != app_map_.end(); |
| 394 ++i) { | 395 ++i) { |
| 395 if (i->second.id == id) { | 396 if (i->second.id == id) { |
| 396 *tab = i->first; | 397 *tab = i->first; |
| 397 return true; | 398 return true; |
| 398 } | 399 } |
| 399 } | 400 } |
| 400 return false; | 401 return false; |
| 401 } | 402 } |
| OLD | NEW |