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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 return std::vector<content::WebContents*>(); | 640 return std::vector<content::WebContents*>(); |
641 LauncherItemController* controller = GetLauncherItemController(item->id); | 641 LauncherItemController* controller = GetLauncherItemController(item->id); |
642 AppShortcutLauncherItemController* app_controller = | 642 AppShortcutLauncherItemController* app_controller = |
643 static_cast<AppShortcutLauncherItemController*>(controller); | 643 static_cast<AppShortcutLauncherItemController*>(controller); |
644 return app_controller->GetRunningApplications(); | 644 return app_controller->GetRunningApplications(); |
645 } | 645 } |
646 | 646 |
647 void ChromeLauncherControllerImpl::ActivateShellApp(const std::string& app_id, | 647 void ChromeLauncherControllerImpl::ActivateShellApp(const std::string& app_id, |
648 int window_index) { | 648 int window_index) { |
649 const ash::ShelfItem* item = GetItem(GetShelfIDForAppID(app_id)); | 649 const ash::ShelfItem* item = GetItem(GetShelfIDForAppID(app_id)); |
650 if (item && item->type == ash::TYPE_APP) { | 650 if (item && |
651 (item->type == ash::TYPE_APP || item->type == ash::TYPE_APP_SHORTCUT)) { | |
651 LauncherItemController* controller = GetLauncherItemController(item->id); | 652 LauncherItemController* controller = GetLauncherItemController(item->id); |
652 AppWindowLauncherItemController* app_window_controller = | 653 AppWindowLauncherItemController* app_window_controller = |
653 static_cast<AppWindowLauncherItemController*>(controller); | 654 static_cast<AppWindowLauncherItemController*>(controller); |
msw
2017/01/11 20:01:55
It is really safe to static-cast the controller fo
Qiang(Joe) Xu
2017/01/11 21:09:14
ok thanks, let me first bisect to check why it bec
msw
2017/01/11 21:54:44
Your current change seems correct, albeit lacking
Qiang(Joe) Xu
2017/01/11 22:34:21
<<<<<<<<<<<<<<<<Thanks for this info.
msw
2017/01/11 22:52:26
On 2017/01/11 22:34:21, Qiang(Joe) Xu wrote:
< Sin
James Cook
2017/01/11 22:55:24
Can you add some documentation in the code explain
| |
654 app_window_controller->ActivateIndexedApp(window_index); | 655 app_window_controller->ActivateIndexedApp(window_index); |
655 } | 656 } |
656 } | 657 } |
657 | 658 |
658 bool ChromeLauncherControllerImpl::IsWebContentHandledByApplication( | 659 bool ChromeLauncherControllerImpl::IsWebContentHandledByApplication( |
659 content::WebContents* web_contents, | 660 content::WebContents* web_contents, |
660 const std::string& app_id) { | 661 const std::string& app_id) { |
661 if ((web_contents_to_app_id_.find(web_contents) != | 662 if ((web_contents_to_app_id_.find(web_contents) != |
662 web_contents_to_app_id_.end()) && | 663 web_contents_to_app_id_.end()) && |
663 (web_contents_to_app_id_[web_contents] == app_id)) | 664 (web_contents_to_app_id_[web_contents] == app_id)) |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1465 LauncherItemController* controller = GetLauncherItemController(item.id); | 1466 LauncherItemController* controller = GetLauncherItemController(item.id); |
1466 if (!controller || controller->image_set_by_controller()) | 1467 if (!controller || controller->image_set_by_controller()) |
1467 continue; | 1468 continue; |
1468 item.image = image; | 1469 item.image = image; |
1469 if (arc_deferred_launcher_) | 1470 if (arc_deferred_launcher_) |
1470 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1471 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
1471 model_->Set(index, item); | 1472 model_->Set(index, item); |
1472 // It's possible we're waiting on more than one item, so don't break. | 1473 // It's possible we're waiting on more than one item, so don't break. |
1473 } | 1474 } |
1474 } | 1475 } |
OLD | NEW |