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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 691 |
692 void Shell::OnAppTerminating() { | 692 void Shell::OnAppTerminating() { |
693 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); | 693 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); |
694 } | 694 } |
695 | 695 |
696 void Shell::OnLockStateChanged(bool locked) { | 696 void Shell::OnLockStateChanged(bool locked) { |
697 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLockStateChanged(locked)); | 697 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLockStateChanged(locked)); |
698 } | 698 } |
699 | 699 |
700 void Shell::CreateLauncher() { | 700 void Shell::CreateLauncher() { |
701 GetPrimaryRootWindowController()->CreateLauncher(); | 701 if (IsLauncherPerDisplayEnabled()) { |
| 702 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 703 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 704 iter != controllers.end(); ++iter) |
| 705 (*iter)->CreateLauncher(); |
| 706 } else { |
| 707 GetPrimaryRootWindowController()->CreateLauncher(); |
| 708 } |
702 } | 709 } |
703 | 710 |
704 void Shell::ShowLauncher() { | 711 void Shell::ShowLauncher() { |
705 GetPrimaryRootWindowController()->ShowLauncher(); | 712 GetPrimaryRootWindowController()->ShowLauncher(); |
706 } | 713 } |
707 | 714 |
708 void Shell::AddShellObserver(ShellObserver* observer) { | 715 void Shell::AddShellObserver(ShellObserver* observer) { |
709 observers_.AddObserver(observer); | 716 observers_.AddObserver(observer); |
710 } | 717 } |
711 | 718 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 iter != controllers.end(); ++iter) | 781 iter != controllers.end(); ++iter) |
775 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); | 782 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); |
776 } | 783 } |
777 } | 784 } |
778 | 785 |
779 WebNotificationTray* Shell::GetWebNotificationTray() { | 786 WebNotificationTray* Shell::GetWebNotificationTray() { |
780 return GetPrimaryRootWindowController()->status_area_widget()-> | 787 return GetPrimaryRootWindowController()->status_area_widget()-> |
781 web_notification_tray(); | 788 web_notification_tray(); |
782 } | 789 } |
783 | 790 |
784 internal::StatusAreaWidget* Shell::status_area_widget() { | 791 bool Shell::HasPrimaryStatusArea() { |
785 return GetPrimaryRootWindowController()->status_area_widget(); | 792 return !!GetPrimaryRootWindowController()->status_area_widget(); |
786 } | 793 } |
787 | 794 |
788 SystemTray* Shell::system_tray() { | 795 SystemTray* Shell::GetPrimarySystemTray() { |
789 // We assume in throughout the code that this will not return NULL. If code | 796 return GetPrimaryRootWindowController()->GetSystemTray(); |
790 // triggers this for valid reasons, it should test status_area_widget first. | |
791 internal::StatusAreaWidget* status_area = status_area_widget(); | |
792 CHECK(status_area); | |
793 return status_area->system_tray(); | |
794 } | 797 } |
795 | 798 |
796 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { | 799 void Shell::InitRootWindowForSecondaryDisplay(aura::RootWindow* root) { |
797 aura::client::SetFocusClient(root, focus_client_.get()); | 800 aura::client::SetFocusClient(root, focus_client_.get()); |
798 internal::RootWindowController* controller = | 801 internal::RootWindowController* controller = |
799 new internal::RootWindowController(root); | 802 new internal::RootWindowController(root); |
800 controller->CreateContainers(); | 803 controller->CreateContainers(); |
801 // Pass false for the |is_first_run_after_boot| parameter so we'll show a | 804 // Pass false for the |is_first_run_after_boot| parameter so we'll show a |
802 // black background on this display instead of trying to mimic the boot splash | 805 // black background on this display instead of trying to mimic the boot splash |
803 // screen. | 806 // screen. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 | 905 |
903 void Shell::OnEvent(ui::Event* event) { | 906 void Shell::OnEvent(ui::Event* event) { |
904 if (event->type() == | 907 if (event->type() == |
905 views::corewm::FocusChangeEvent::activation_changed_event_type()) { | 908 views::corewm::FocusChangeEvent::activation_changed_event_type()) { |
906 active_root_window_ = | 909 active_root_window_ = |
907 static_cast<aura::Window*>(event->target())->GetRootWindow(); | 910 static_cast<aura::Window*>(event->target())->GetRootWindow(); |
908 } | 911 } |
909 } | 912 } |
910 | 913 |
911 } // namespace ash | 914 } // namespace ash |
OLD | NEW |