OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 return std::vector<content::WebContents*>(); | 642 return std::vector<content::WebContents*>(); |
643 LauncherItemController* controller = GetLauncherItemController(item->id); | 643 LauncherItemController* controller = GetLauncherItemController(item->id); |
644 AppShortcutLauncherItemController* app_controller = | 644 AppShortcutLauncherItemController* app_controller = |
645 static_cast<AppShortcutLauncherItemController*>(controller); | 645 static_cast<AppShortcutLauncherItemController*>(controller); |
646 return app_controller->GetRunningApplications(); | 646 return app_controller->GetRunningApplications(); |
647 } | 647 } |
648 | 648 |
649 void ChromeLauncherControllerImpl::ActivateShellApp(const std::string& app_id, | 649 void ChromeLauncherControllerImpl::ActivateShellApp(const std::string& app_id, |
650 int window_index) { | 650 int window_index) { |
651 const ash::ShelfItem* item = GetItem(GetShelfIDForAppID(app_id)); | 651 const ash::ShelfItem* item = GetItem(GetShelfIDForAppID(app_id)); |
652 if (item && item->type == ash::TYPE_APP) { | 652 if (item && |
| 653 (item->type == ash::TYPE_APP || item->type == ash::TYPE_APP_SHORTCUT)) { |
653 LauncherItemController* controller = GetLauncherItemController(item->id); | 654 LauncherItemController* controller = GetLauncherItemController(item->id); |
654 AppWindowLauncherItemController* app_window_controller = | 655 AppWindowLauncherItemController* app_window_controller = |
655 static_cast<AppWindowLauncherItemController*>(controller); | 656 controller->AsAppWindowLauncherItemController(); |
| 657 DCHECK(app_window_controller); |
656 app_window_controller->ActivateIndexedApp(window_index); | 658 app_window_controller->ActivateIndexedApp(window_index); |
657 } | 659 } |
658 } | 660 } |
659 | 661 |
660 bool ChromeLauncherControllerImpl::IsWebContentHandledByApplication( | 662 bool ChromeLauncherControllerImpl::IsWebContentHandledByApplication( |
661 content::WebContents* web_contents, | 663 content::WebContents* web_contents, |
662 const std::string& app_id) { | 664 const std::string& app_id) { |
663 if ((web_contents_to_app_id_.find(web_contents) != | 665 if ((web_contents_to_app_id_.find(web_contents) != |
664 web_contents_to_app_id_.end()) && | 666 web_contents_to_app_id_.end()) && |
665 (web_contents_to_app_id_[web_contents] == app_id)) | 667 (web_contents_to_app_id_[web_contents] == app_id)) |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 LauncherItemController* controller = GetLauncherItemController(item.id); | 1480 LauncherItemController* controller = GetLauncherItemController(item.id); |
1479 if (!controller || controller->image_set_by_controller()) | 1481 if (!controller || controller->image_set_by_controller()) |
1480 continue; | 1482 continue; |
1481 item.image = image; | 1483 item.image = image; |
1482 if (arc_deferred_launcher_) | 1484 if (arc_deferred_launcher_) |
1483 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1485 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
1484 model_->Set(index, item); | 1486 model_->Set(index, item); |
1485 // It's possible we're waiting on more than one item, so don't break. | 1487 // It's possible we're waiting on more than one item, so don't break. |
1486 } | 1488 } |
1487 } | 1489 } |
OLD | NEW |