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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 | 663 |
664 void Shell::OnAppTerminating() { | 664 void Shell::OnAppTerminating() { |
665 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); | 665 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); |
666 } | 666 } |
667 | 667 |
668 void Shell::OnLockStateChanged(bool locked) { | 668 void Shell::OnLockStateChanged(bool locked) { |
669 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLockStateChanged(locked)); | 669 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLockStateChanged(locked)); |
670 } | 670 } |
671 | 671 |
672 void Shell::CreateLauncher() { | 672 void Shell::CreateLauncher() { |
673 GetPrimaryRootWindowController()->CreateLauncher(); | 673 if (IsLauncherPerDisplayEnabled()) { |
| 674 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 675 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 676 iter != controllers.end(); ++iter) |
| 677 (*iter)->CreateLauncher(); |
| 678 } else { |
| 679 GetPrimaryRootWindowController()->CreateLauncher(); |
| 680 } |
674 } | 681 } |
675 | 682 |
676 void Shell::ShowLauncher() { | 683 void Shell::ShowLauncher() { |
677 GetPrimaryRootWindowController()->ShowLauncher(); | 684 GetPrimaryRootWindowController()->ShowLauncher(); |
678 } | 685 } |
679 | 686 |
680 void Shell::AddShellObserver(ShellObserver* observer) { | 687 void Shell::AddShellObserver(ShellObserver* observer) { |
681 observers_.AddObserver(observer); | 688 observers_.AddObserver(observer); |
682 } | 689 } |
683 | 690 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 iter != controllers.end(); ++iter) | 753 iter != controllers.end(); ++iter) |
747 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); | 754 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); |
748 } | 755 } |
749 } | 756 } |
750 | 757 |
751 WebNotificationTray* Shell::GetWebNotificationTray() { | 758 WebNotificationTray* Shell::GetWebNotificationTray() { |
752 return GetPrimaryRootWindowController()->status_area_widget()-> | 759 return GetPrimaryRootWindowController()->status_area_widget()-> |
753 web_notification_tray(); | 760 web_notification_tray(); |
754 } | 761 } |
755 | 762 |
756 internal::StatusAreaWidget* Shell::status_area_widget() { | 763 bool Shell::HasPrimaryStatusArea() { |
757 return GetPrimaryRootWindowController()->status_area_widget(); | 764 return !!GetPrimaryRootWindowController()->status_area_widget(); |
758 } | 765 } |
759 | 766 |
760 SystemTray* Shell::system_tray() { | 767 SystemTray* Shell::GetPrimarySystemTray() { |
761 // We assume in throughout the code that this will not return NULL. If code | 768 return GetPrimaryRootWindowController()->GetSystemTray(); |
762 // triggers this for valid reasons, it should test status_area_widget first. | |
763 internal::StatusAreaWidget* status_area = status_area_widget(); | |
764 CHECK(status_area); | |
765 return status_area->system_tray(); | |
766 } | 769 } |
767 | 770 |
768 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { | 771 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { |
769 aura::client::SetFocusClient(root, focus_client_.get()); | 772 aura::client::SetFocusClient(root, focus_client_.get()); |
770 internal::RootWindowController* controller = | 773 internal::RootWindowController* controller = |
771 new internal::RootWindowController(root); | 774 new internal::RootWindowController(root); |
772 controller->CreateContainers(); | 775 controller->CreateContainers(); |
773 // Pass false for the |is_first_run_after_boot| parameter so we'll show a | 776 // Pass false for the |is_first_run_after_boot| parameter so we'll show a |
774 // black background on this display instead of trying to mimic the boot splash | 777 // black background on this display instead of trying to mimic the boot splash |
775 // screen. | 778 // screen. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 | 877 |
875 void Shell::OnEvent(ui::Event* event) { | 878 void Shell::OnEvent(ui::Event* event) { |
876 if (event->type() == | 879 if (event->type() == |
877 views::corewm::FocusChangeEvent::activation_changed_event_type()) { | 880 views::corewm::FocusChangeEvent::activation_changed_event_type()) { |
878 active_root_window_ = | 881 active_root_window_ = |
879 static_cast<aura::Window*>(event->target())->GetRootWindow(); | 882 static_cast<aura::Window*>(event->target())->GetRootWindow(); |
880 } | 883 } |
881 } | 884 } |
882 | 885 |
883 } // namespace ash | 886 } // namespace ash |
OLD | NEW |