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/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 tab->web_contents()); | 297 tab->web_contents()); |
298 TabStripModel* tab_strip = browser->tab_strip_model(); | 298 TabStripModel* tab_strip = browser->tab_strip_model(); |
299 int index = tab_strip->GetIndexOfTabContents(tab); | 299 int index = tab_strip->GetIndexOfTabContents(tab); |
300 DCHECK_NE(TabStripModel::kNoTab, index); | 300 DCHECK_NE(TabStripModel::kNoTab, index); |
301 tab_strip->ActivateTabAt(index, false); | 301 tab_strip->ActivateTabAt(index, false); |
302 browser->window()->Show(); | 302 browser->window()->Show(); |
303 ash::wm::ActivateWindow(browser->window()->GetNativeWindow()); | 303 ash::wm::ActivateWindow(browser->window()->GetNativeWindow()); |
304 } else { | 304 } else { |
305 const Extension* extension = | 305 const Extension* extension = |
306 profile_->GetExtensionService()->GetInstalledExtension(app_id); | 306 profile_->GetExtensionService()->GetInstalledExtension(app_id); |
307 extension_utils::OpenExtension(profile_, extension, event_flags); | 307 extension_utils::OpenExtension(GetProfileForNewWindows(), |
| 308 extension, |
| 309 event_flags); |
308 } | 310 } |
309 } | 311 } |
310 | 312 |
311 void ChromeLauncherController::Close(ash::LauncherID id) { | 313 void ChromeLauncherController::Close(ash::LauncherID id) { |
312 if (id_to_item_map_.find(id) == id_to_item_map_.end()) | 314 if (id_to_item_map_.find(id) == id_to_item_map_.end()) |
313 return; // May happen if menu closed. | 315 return; // May happen if menu closed. |
314 | 316 |
315 if (!id_to_item_map_[id].controller) | 317 if (!id_to_item_map_[id].controller) |
316 return; // TODO: maybe should treat as unpin? | 318 return; // TODO: maybe should treat as unpin? |
317 | 319 |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 } | 989 } |
988 model_->AddAt(index, item); | 990 model_->AddAt(index, item); |
989 | 991 |
990 if (!controller || controller->type() != | 992 if (!controller || controller->type() != |
991 BrowserLauncherItemController::TYPE_EXTENSION_PANEL) { | 993 BrowserLauncherItemController::TYPE_EXTENSION_PANEL) { |
992 if (item.status != ash::STATUS_IS_PENDING) | 994 if (item.status != ash::STATUS_IS_PENDING) |
993 app_icon_loader_->FetchImage(app_id); | 995 app_icon_loader_->FetchImage(app_id); |
994 } | 996 } |
995 return id; | 997 return id; |
996 } | 998 } |
OLD | NEW |