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 10 matching lines...) Expand all Loading... | |
21 #include "ash/drag_drop/drag_drop_controller.h" | 21 #include "ash/drag_drop/drag_drop_controller.h" |
22 #include "ash/focus_cycler.h" | 22 #include "ash/focus_cycler.h" |
23 #include "ash/high_contrast/high_contrast_controller.h" | 23 #include "ash/high_contrast/high_contrast_controller.h" |
24 #include "ash/host/root_window_host_factory.h" | 24 #include "ash/host/root_window_host_factory.h" |
25 #include "ash/launcher/launcher_delegate.h" | 25 #include "ash/launcher/launcher_delegate.h" |
26 #include "ash/launcher/launcher_model.h" | 26 #include "ash/launcher/launcher_model.h" |
27 #include "ash/magnifier/magnification_controller.h" | 27 #include "ash/magnifier/magnification_controller.h" |
28 #include "ash/magnifier/partial_magnification_controller.h" | 28 #include "ash/magnifier/partial_magnification_controller.h" |
29 #include "ash/root_window_controller.h" | 29 #include "ash/root_window_controller.h" |
30 #include "ash/screen_ash.h" | 30 #include "ash/screen_ash.h" |
31 #include "ash/shelf/shelf_layout_manager.h" | |
32 #include "ash/shelf/shelf_widget.h" | |
31 #include "ash/shell_delegate.h" | 33 #include "ash/shell_delegate.h" |
32 #include "ash/shell_factory.h" | 34 #include "ash/shell_factory.h" |
33 #include "ash/shell_window_ids.h" | 35 #include "ash/shell_window_ids.h" |
34 #include "ash/system/status_area_widget.h" | 36 #include "ash/system/status_area_widget.h" |
35 #include "ash/system/tray/system_tray_delegate.h" | 37 #include "ash/system/tray/system_tray_delegate.h" |
36 #include "ash/system/tray/system_tray_notifier.h" | 38 #include "ash/system/tray/system_tray_notifier.h" |
37 #include "ash/touch/touch_observer_hud.h" | 39 #include "ash/touch/touch_observer_hud.h" |
38 #include "ash/wm/activation_controller.h" | 40 #include "ash/wm/activation_controller.h" |
39 #include "ash/wm/always_on_top_controller.h" | 41 #include "ash/wm/always_on_top_controller.h" |
40 #include "ash/wm/app_list_controller.h" | 42 #include "ash/wm/app_list_controller.h" |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 iter != controllers.end(); ++iter) | 704 iter != controllers.end(); ++iter) |
703 (*iter)->UpdateAfterLoginStatusChange(status); | 705 (*iter)->UpdateAfterLoginStatusChange(status); |
704 } | 706 } |
705 | 707 |
706 void Shell::OnAppTerminating() { | 708 void Shell::OnAppTerminating() { |
707 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); | 709 FOR_EACH_OBSERVER(ShellObserver, observers_, OnAppTerminating()); |
708 } | 710 } |
709 | 711 |
710 void Shell::OnLockStateChanged(bool locked) { | 712 void Shell::OnLockStateChanged(bool locked) { |
711 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLockStateChanged(locked)); | 713 FOR_EACH_OBSERVER(ShellObserver, observers_, OnLockStateChanged(locked)); |
712 } | 714 } |
Mr4D (OOO till 08-26)
2013/03/02 02:02:12
newline
Harry McCleave
2013/03/04 02:47:41
Done.
| |
713 | |
714 void Shell::CreateLauncher() { | 715 void Shell::CreateLauncher() { |
715 if (IsLauncherPerDisplayEnabled()) { | 716 if (IsLauncherPerDisplayEnabled()) { |
716 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 717 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
717 for (RootWindowControllerList::iterator iter = controllers.begin(); | 718 for (RootWindowControllerList::iterator iter = controllers.begin(); |
718 iter != controllers.end(); ++iter) | 719 iter != controllers.end(); ++iter) |
Mr4D (OOO till 08-26)
2013/03/02 02:02:12
one space
Harry McCleave
2013/03/04 02:47:41
Done.
| |
719 (*iter)->CreateLauncher(); | 720 (*iter)->shelf()->CreateLauncher(); |
720 } else { | 721 } else { |
721 GetPrimaryRootWindowController()->CreateLauncher(); | 722 GetPrimaryRootWindowController()->shelf()->CreateLauncher(); |
722 } | 723 } |
723 } | 724 } |
724 | 725 |
725 void Shell::ShowLauncher() { | 726 void Shell::ShowLauncher() { |
726 if (IsLauncherPerDisplayEnabled()) { | 727 if (IsLauncherPerDisplayEnabled()) { |
727 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 728 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
728 for (RootWindowControllerList::iterator iter = controllers.begin(); | 729 for (RootWindowControllerList::iterator iter = controllers.begin(); |
729 iter != controllers.end(); ++iter) | 730 iter != controllers.end(); ++iter) |
Mr4D (OOO till 08-26)
2013/03/02 02:02:12
one space
Harry McCleave
2013/03/04 02:47:41
Done.
| |
730 (*iter)->ShowLauncher(); | 731 (*iter)->ShowLauncher(); |
731 } else { | 732 } else { |
732 GetPrimaryRootWindowController()->ShowLauncher(); | 733 GetPrimaryRootWindowController()->ShowLauncher(); |
733 } | 734 } |
734 } | 735 } |
735 | 736 |
736 void Shell::AddShellObserver(ShellObserver* observer) { | 737 void Shell::AddShellObserver(ShellObserver* observer) { |
737 observers_.AddObserver(observer); | 738 observers_.AddObserver(observer); |
738 } | 739 } |
739 | 740 |
740 void Shell::RemoveShellObserver(ShellObserver* observer) { | 741 void Shell::RemoveShellObserver(ShellObserver* observer) { |
741 observers_.RemoveObserver(observer); | 742 observers_.RemoveObserver(observer); |
742 } | 743 } |
743 | 744 |
744 void Shell::UpdateShelfVisibility() { | 745 void Shell::UpdateShelfVisibility() { |
745 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 746 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
746 for (RootWindowControllerList::iterator iter = controllers.begin(); | 747 for (RootWindowControllerList::iterator iter = controllers.begin(); |
747 iter != controllers.end(); ++iter) | 748 iter != controllers.end(); ++iter) |
748 if ((*iter)->shelf()) | 749 if ((*iter)->shelf()) |
749 (*iter)->UpdateShelfVisibility(); | 750 (*iter)->UpdateShelfVisibility(); |
750 } | 751 } |
751 | 752 |
752 void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, | 753 void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, |
753 aura::RootWindow* root_window) { | 754 aura::RootWindow* root_window) { |
754 GetRootWindowController(root_window)->SetShelfAutoHideBehavior(behavior); | 755 ash::internal::ShelfLayoutManager::ForLauncher(root_window)-> |
756 SetAutoHideBehavior(behavior); | |
755 } | 757 } |
756 | 758 |
757 ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior( | 759 ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior( |
758 aura::RootWindow* root_window) const { | 760 aura::RootWindow* root_window) const { |
759 return GetRootWindowController(root_window)->GetShelfAutoHideBehavior(); | 761 return ash::internal::ShelfLayoutManager::ForLauncher(root_window)-> |
762 auto_hide_behavior(); | |
760 } | 763 } |
761 | 764 |
762 void Shell::SetShelfAlignment(ShelfAlignment alignment, | 765 void Shell::SetShelfAlignment(ShelfAlignment alignment, |
763 aura::RootWindow* root_window) { | 766 aura::RootWindow* root_window) { |
764 if (GetRootWindowController(root_window)->SetShelfAlignment(alignment)) { | 767 if (ash::internal::ShelfLayoutManager::ForLauncher(root_window)-> |
768 SetAlignment(alignment)) { | |
765 FOR_EACH_OBSERVER( | 769 FOR_EACH_OBSERVER( |
766 ShellObserver, observers_, OnShelfAlignmentChanged(root_window)); | 770 ShellObserver, observers_, OnShelfAlignmentChanged(root_window)); |
767 } | 771 } |
768 } | 772 } |
769 | 773 |
770 ShelfAlignment Shell::GetShelfAlignment(aura::RootWindow* root_window) { | 774 ShelfAlignment Shell::GetShelfAlignment(aura::RootWindow* root_window) { |
771 return GetRootWindowController(root_window)->GetShelfAlignment(); | 775 return GetRootWindowController(root_window)-> |
776 shelf_layout_manager()->GetAlignment(); | |
772 } | 777 } |
773 | 778 |
774 void Shell::SetDimming(bool should_dim) { | 779 void Shell::SetDimming(bool should_dim) { |
775 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 780 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
776 for (RootWindowControllerList::iterator iter = controllers.begin(); | 781 for (RootWindowControllerList::iterator iter = controllers.begin(); |
777 iter != controllers.end(); ++iter) | 782 iter != controllers.end(); ++iter) |
778 (*iter)->screen_dimmer()->SetDimming(should_dim); | 783 (*iter)->screen_dimmer()->SetDimming(should_dim); |
779 } | 784 } |
780 | 785 |
781 void Shell::CreateModalBackground(aura::Window* window) { | 786 void Shell::CreateModalBackground(aura::Window* window) { |
(...skipping 18 matching lines...) Expand all Loading... | |
800 if (!activated) { | 805 if (!activated) { |
801 RemovePreTargetHandler(modality_filter_.get()); | 806 RemovePreTargetHandler(modality_filter_.get()); |
802 modality_filter_.reset(); | 807 modality_filter_.reset(); |
803 for (RootWindowControllerList::iterator iter = controllers.begin(); | 808 for (RootWindowControllerList::iterator iter = controllers.begin(); |
804 iter != controllers.end(); ++iter) | 809 iter != controllers.end(); ++iter) |
805 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); | 810 (*iter)->GetSystemModalLayoutManager(removed)->DestroyModalBackground(); |
806 } | 811 } |
807 } | 812 } |
808 | 813 |
809 WebNotificationTray* Shell::GetWebNotificationTray() { | 814 WebNotificationTray* Shell::GetWebNotificationTray() { |
810 return GetPrimaryRootWindowController()->status_area_widget()-> | 815 return GetPrimaryRootWindowController()->shelf()-> |
811 web_notification_tray(); | 816 status_area_widget()->web_notification_tray(); |
812 } | 817 } |
813 | 818 |
814 bool Shell::HasPrimaryStatusArea() { | 819 bool Shell::HasPrimaryStatusArea() { |
815 return !!GetPrimaryRootWindowController()->status_area_widget(); | 820 return !!GetPrimaryRootWindowController()-> |
821 shelf()->status_area_widget(); | |
816 } | 822 } |
817 | 823 |
818 SystemTray* Shell::GetPrimarySystemTray() { | 824 SystemTray* Shell::GetPrimarySystemTray() { |
819 return GetPrimaryRootWindowController()->GetSystemTray(); | 825 return GetPrimaryRootWindowController()->GetSystemTray(); |
820 } | 826 } |
821 | 827 |
822 LauncherDelegate* Shell::GetLauncherDelegate() { | 828 LauncherDelegate* Shell::GetLauncherDelegate() { |
823 if (!launcher_delegate_.get()) { | 829 if (!launcher_delegate_.get()) { |
824 launcher_model_.reset(new LauncherModel); | 830 launcher_model_.reset(new LauncherModel); |
825 launcher_delegate_.reset( | 831 launcher_delegate_.reset( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 //////////////////////////////////////////////////////////////////////////////// | 949 //////////////////////////////////////////////////////////////////////////////// |
944 // Shell, aura::client::ActivationChangeObserver implementation: | 950 // Shell, aura::client::ActivationChangeObserver implementation: |
945 | 951 |
946 void Shell::OnWindowActivated(aura::Window* gained_active, | 952 void Shell::OnWindowActivated(aura::Window* gained_active, |
947 aura::Window* lost_active) { | 953 aura::Window* lost_active) { |
948 if (gained_active) | 954 if (gained_active) |
949 active_root_window_ = gained_active->GetRootWindow(); | 955 active_root_window_ = gained_active->GetRootWindow(); |
950 } | 956 } |
951 | 957 |
952 } // namespace ash | 958 } // namespace ash |
OLD | NEW |