Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: ash/shell.cc

Issue 196063002: Move wm/core to wm namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell.h ('k') | ash/shell/content_client/shell_browser_main_parts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/accelerator_controller.h" 10 #include "ash/accelerators/accelerator_controller.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 namespace ash { 138 namespace ash {
139 139
140 namespace { 140 namespace {
141 141
142 using aura::Window; 142 using aura::Window;
143 using views::Widget; 143 using views::Widget;
144 144
145 // A Corewm VisibilityController subclass that calls the Ash animation routine 145 // A Corewm VisibilityController subclass that calls the Ash animation routine
146 // so we can pick up our extended animations. See ash/wm/window_animations.h. 146 // so we can pick up our extended animations. See ash/wm/window_animations.h.
147 class AshVisibilityController : public views::corewm::VisibilityController { 147 class AshVisibilityController : public ::wm::VisibilityController {
148 public: 148 public:
149 AshVisibilityController() {} 149 AshVisibilityController() {}
150 virtual ~AshVisibilityController() {} 150 virtual ~AshVisibilityController() {}
151 151
152 private: 152 private:
153 // Overridden from views::corewm::VisibilityController: 153 // Overridden from ::wm::VisibilityController:
154 virtual bool CallAnimateOnChildWindowVisibilityChanged( 154 virtual bool CallAnimateOnChildWindowVisibilityChanged(
155 aura::Window* window, 155 aura::Window* window,
156 bool visible) OVERRIDE { 156 bool visible) OVERRIDE {
157 return AnimateOnChildWindowVisibilityChanged(window, visible); 157 return AnimateOnChildWindowVisibilityChanged(window, visible);
158 } 158 }
159 159
160 DISALLOW_COPY_AND_ASSIGN(AshVisibilityController); 160 DISALLOW_COPY_AND_ASSIGN(AshVisibilityController);
161 }; 161 };
162 162
163 } // namespace 163 } // namespace
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 Shell::Shell(ShellDelegate* delegate) 603 Shell::Shell(ShellDelegate* delegate)
604 : target_root_window_(NULL), 604 : target_root_window_(NULL),
605 scoped_target_root_window_(NULL), 605 scoped_target_root_window_(NULL),
606 delegate_(delegate), 606 delegate_(delegate),
607 window_positioner_(new WindowPositioner), 607 window_positioner_(new WindowPositioner),
608 activation_client_(NULL), 608 activation_client_(NULL),
609 #if defined(OS_CHROMEOS) && defined(USE_X11) 609 #if defined(OS_CHROMEOS) && defined(USE_X11)
610 output_configurator_(new chromeos::OutputConfigurator()), 610 output_configurator_(new chromeos::OutputConfigurator()),
611 #endif // defined(OS_CHROMEOS) && defined(USE_X11) 611 #endif // defined(OS_CHROMEOS) && defined(USE_X11)
612 native_cursor_manager_(new AshNativeCursorManager), 612 native_cursor_manager_(new AshNativeCursorManager),
613 cursor_manager_(scoped_ptr<views::corewm::NativeCursorManager>( 613 cursor_manager_(scoped_ptr< ::wm::NativeCursorManager>(
614 native_cursor_manager_)), 614 native_cursor_manager_)),
615 simulate_modal_window_open_for_testing_(false), 615 simulate_modal_window_open_for_testing_(false),
616 is_touch_hud_projection_enabled_(false) { 616 is_touch_hud_projection_enabled_(false) {
617 DCHECK(delegate_.get()); 617 DCHECK(delegate_.get());
618 gpu_support_.reset(delegate_->CreateGPUSupport()); 618 gpu_support_.reset(delegate_->CreateGPUSupport());
619 display_manager_.reset(new internal::DisplayManager); 619 display_manager_.reset(new internal::DisplayManager);
620 display_controller_.reset(new DisplayController); 620 display_controller_.reset(new DisplayController);
621 #if defined(OS_CHROMEOS) && defined(USE_X11) 621 #if defined(OS_CHROMEOS) && defined(USE_X11)
622 user_metrics_recorder_.reset(new UserMetricsRecorder); 622 user_metrics_recorder_.reset(new UserMetricsRecorder);
623 #endif // defined(OS_CHROMEOS) 623 #endif // defined(OS_CHROMEOS)
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 819
820 // Env creates the compositor. Historically it seems to have been implicitly 820 // Env creates the compositor. Historically it seems to have been implicitly
821 // initialized first by the ActivationController, but now that FocusController 821 // initialized first by the ActivationController, but now that FocusController
822 // no longer does this we need to do it explicitly. 822 // no longer does this we need to do it explicitly.
823 aura::Env::CreateInstance(); 823 aura::Env::CreateInstance();
824 824
825 // The WindowModalityController needs to be at the front of the input event 825 // The WindowModalityController needs to be at the front of the input event
826 // pretarget handler list to ensure that it processes input events when modal 826 // pretarget handler list to ensure that it processes input events when modal
827 // windows are active. 827 // windows are active.
828 window_modality_controller_.reset( 828 window_modality_controller_.reset(
829 new views::corewm::WindowModalityController(this)); 829 new ::wm::WindowModalityController(this));
830 830
831 AddPreTargetHandler(this); 831 AddPreTargetHandler(this);
832 832
833 env_filter_.reset(new views::corewm::CompoundEventFilter); 833 env_filter_.reset(new ::wm::CompoundEventFilter);
834 AddPreTargetHandler(env_filter_.get()); 834 AddPreTargetHandler(env_filter_.get());
835 835
836 views::corewm::FocusController* focus_controller = 836 ::wm::FocusController* focus_controller =
837 new views::corewm::FocusController(new wm::AshFocusRules); 837 new ::wm::FocusController(new wm::AshFocusRules);
838 focus_client_.reset(focus_controller); 838 focus_client_.reset(focus_controller);
839 activation_client_ = focus_controller; 839 activation_client_ = focus_controller;
840 activation_client_->AddObserver(this); 840 activation_client_->AddObserver(this);
841 focus_cycler_.reset(new internal::FocusCycler()); 841 focus_cycler_.reset(new internal::FocusCycler());
842 842
843 screen_position_controller_.reset(new internal::ScreenPositionController); 843 screen_position_controller_.reset(new internal::ScreenPositionController);
844 window_tree_host_factory_.reset(delegate_->CreateWindowTreeHostFactory()); 844 window_tree_host_factory_.reset(delegate_->CreateWindowTreeHostFactory());
845 845
846 display_controller_->Start(); 846 display_controller_->Start();
847 display_controller_->InitPrimaryDisplay(); 847 display_controller_->InitPrimaryDisplay();
(...skipping 28 matching lines...) Expand all
876 876
877 // UserActivityDetector passes events to observers, so let them get 877 // UserActivityDetector passes events to observers, so let them get
878 // rewritten first. 878 // rewritten first.
879 user_activity_detector_.reset(new UserActivityDetector); 879 user_activity_detector_.reset(new UserActivityDetector);
880 AddPreTargetHandler(user_activity_detector_.get()); 880 AddPreTargetHandler(user_activity_detector_.get());
881 881
882 overlay_filter_.reset(new internal::OverlayEventFilter); 882 overlay_filter_.reset(new internal::OverlayEventFilter);
883 AddPreTargetHandler(overlay_filter_.get()); 883 AddPreTargetHandler(overlay_filter_.get());
884 AddShellObserver(overlay_filter_.get()); 884 AddShellObserver(overlay_filter_.get());
885 885
886 input_method_filter_.reset(new views::corewm::InputMethodEventFilter( 886 input_method_filter_.reset(new ::wm::InputMethodEventFilter(
887 root_window->GetHost()->GetAcceleratedWidget())); 887 root_window->GetHost()->GetAcceleratedWidget()));
888 AddPreTargetHandler(input_method_filter_.get()); 888 AddPreTargetHandler(input_method_filter_.get());
889 889
890 accelerator_filter_.reset(new internal::AcceleratorFilter); 890 accelerator_filter_.reset(new internal::AcceleratorFilter);
891 AddPreTargetHandler(accelerator_filter_.get()); 891 AddPreTargetHandler(accelerator_filter_.get());
892 892
893 event_transformation_handler_.reset(new internal::EventTransformationHandler); 893 event_transformation_handler_.reset(new internal::EventTransformationHandler);
894 AddPreTargetHandler(event_transformation_handler_.get()); 894 AddPreTargetHandler(event_transformation_handler_.get());
895 895
896 toplevel_window_event_handler_.reset(new ToplevelWindowEventHandler); 896 toplevel_window_event_handler_.reset(new ToplevelWindowEventHandler);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 desktop_background_controller_.reset(new DesktopBackgroundController()); 951 desktop_background_controller_.reset(new DesktopBackgroundController());
952 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); 952 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate());
953 953
954 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate()); 954 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate());
955 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); 955 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate());
956 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); 956 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate());
957 media_delegate_.reset(delegate_->CreateMediaDelegate()); 957 media_delegate_.reset(delegate_->CreateMediaDelegate());
958 958
959 resize_shadow_controller_.reset(new internal::ResizeShadowController()); 959 resize_shadow_controller_.reset(new internal::ResizeShadowController());
960 shadow_controller_.reset( 960 shadow_controller_.reset(
961 new views::corewm::ShadowController(activation_client_)); 961 new ::wm::ShadowController(activation_client_));
962 962
963 // Create system_tray_notifier_ before the delegate. 963 // Create system_tray_notifier_ before the delegate.
964 system_tray_notifier_.reset(new ash::SystemTrayNotifier()); 964 system_tray_notifier_.reset(new ash::SystemTrayNotifier());
965 965
966 // Initialize system_tray_delegate_ before initializing StatusAreaWidget. 966 // Initialize system_tray_delegate_ before initializing StatusAreaWidget.
967 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate()); 967 system_tray_delegate_.reset(delegate()->CreateSystemTrayDelegate());
968 DCHECK(system_tray_delegate_.get()); 968 DCHECK(system_tray_delegate_.get());
969 969
970 locale_notification_controller_.reset( 970 locale_notification_controller_.reset(
971 new internal::LocaleNotificationController); 971 new internal::LocaleNotificationController);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 } 1046 }
1047 1047
1048 void Shell::InitRootWindow(aura::Window* root_window) { 1048 void Shell::InitRootWindow(aura::Window* root_window) {
1049 DCHECK(activation_client_); 1049 DCHECK(activation_client_);
1050 DCHECK(visibility_controller_.get()); 1050 DCHECK(visibility_controller_.get());
1051 DCHECK(drag_drop_controller_.get()); 1051 DCHECK(drag_drop_controller_.get());
1052 1052
1053 aura::client::SetFocusClient(root_window, focus_client_.get()); 1053 aura::client::SetFocusClient(root_window, focus_client_.get());
1054 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); 1054 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window);
1055 aura::client::SetActivationClient(root_window, activation_client_); 1055 aura::client::SetActivationClient(root_window, activation_client_);
1056 views::corewm::FocusController* focus_controller = 1056 ::wm::FocusController* focus_controller =
1057 static_cast<views::corewm::FocusController*>(activation_client_); 1057 static_cast< ::wm::FocusController*>(activation_client_);
1058 root_window->AddPreTargetHandler(focus_controller); 1058 root_window->AddPreTargetHandler(focus_controller);
1059 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); 1059 aura::client::SetVisibilityClient(root_window, visibility_controller_.get());
1060 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); 1060 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get());
1061 aura::client::SetScreenPositionClient(root_window, 1061 aura::client::SetScreenPositionClient(root_window,
1062 screen_position_controller_.get()); 1062 screen_position_controller_.get());
1063 aura::client::SetCursorClient(root_window, &cursor_manager_); 1063 aura::client::SetCursorClient(root_window, &cursor_manager_);
1064 aura::client::SetTooltipClient(root_window, tooltip_controller_.get()); 1064 aura::client::SetTooltipClient(root_window, tooltip_controller_.get());
1065 aura::client::SetEventClient(root_window, event_client_.get()); 1065 aura::client::SetEventClient(root_window, event_client_.get());
1066 1066
1067 aura::client::SetWindowMoveClient(root_window, 1067 aura::client::SetWindowMoveClient(root_window,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 //////////////////////////////////////////////////////////////////////////////// 1113 ////////////////////////////////////////////////////////////////////////////////
1114 // Shell, aura::client::ActivationChangeObserver implementation: 1114 // Shell, aura::client::ActivationChangeObserver implementation:
1115 1115
1116 void Shell::OnWindowActivated(aura::Window* gained_active, 1116 void Shell::OnWindowActivated(aura::Window* gained_active,
1117 aura::Window* lost_active) { 1117 aura::Window* lost_active) {
1118 if (gained_active) 1118 if (gained_active)
1119 target_root_window_ = gained_active->GetRootWindow(); 1119 target_root_window_ = gained_active->GetRootWindow();
1120 } 1120 }
1121 1121
1122 } // namespace ash 1122 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/shell/content_client/shell_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698