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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #include "ui/aura/layout_manager.h" | 78 #include "ui/aura/layout_manager.h" |
79 #include "ui/aura/root_window.h" | 79 #include "ui/aura/root_window.h" |
80 #include "ui/aura/window.h" | 80 #include "ui/aura/window.h" |
81 #include "ui/base/ui_base_switches.h" | 81 #include "ui/base/ui_base_switches.h" |
82 #include "ui/compositor/layer.h" | 82 #include "ui/compositor/layer.h" |
83 #include "ui/compositor/layer_animator.h" | 83 #include "ui/compositor/layer_animator.h" |
84 #include "ui/gfx/display.h" | 84 #include "ui/gfx/display.h" |
85 #include "ui/gfx/image/image_skia.h" | 85 #include "ui/gfx/image/image_skia.h" |
86 #include "ui/gfx/screen.h" | 86 #include "ui/gfx/screen.h" |
87 #include "ui/gfx/size.h" | 87 #include "ui/gfx/size.h" |
| 88 #include "ui/message_center/message_center.h" |
88 #include "ui/views/corewm/compound_event_filter.h" | 89 #include "ui/views/corewm/compound_event_filter.h" |
89 #include "ui/views/corewm/corewm_switches.h" | 90 #include "ui/views/corewm/corewm_switches.h" |
90 #include "ui/views/corewm/focus_controller.h" | 91 #include "ui/views/corewm/focus_controller.h" |
91 #include "ui/views/corewm/input_method_event_filter.h" | 92 #include "ui/views/corewm/input_method_event_filter.h" |
92 #include "ui/views/corewm/shadow_controller.h" | 93 #include "ui/views/corewm/shadow_controller.h" |
93 #include "ui/views/corewm/visibility_controller.h" | 94 #include "ui/views/corewm/visibility_controller.h" |
94 #include "ui/views/corewm/window_modality_controller.h" | 95 #include "ui/views/corewm/window_modality_controller.h" |
95 #include "ui/views/focus/focus_manager_factory.h" | 96 #include "ui/views/focus/focus_manager_factory.h" |
96 #include "ui/views/widget/native_widget_aura.h" | 97 #include "ui/views/widget/native_widget_aura.h" |
97 #include "ui/views/widget/widget.h" | 98 #include "ui/views/widget/widget.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 activation_controller_.reset( | 426 activation_controller_.reset( |
426 new internal::ActivationController( | 427 new internal::ActivationController( |
427 focus_client_.get(), | 428 focus_client_.get(), |
428 new internal::AshActivationController)); | 429 new internal::AshActivationController)); |
429 activation_client_ = activation_controller_.get(); | 430 activation_client_ = activation_controller_.get(); |
430 AddPreTargetHandler(activation_controller_.get()); | 431 AddPreTargetHandler(activation_controller_.get()); |
431 } | 432 } |
432 | 433 |
433 focus_cycler_.reset(new internal::FocusCycler()); | 434 focus_cycler_.reset(new internal::FocusCycler()); |
434 | 435 |
| 436 message_center_.reset(new message_center::MessageCenter()); |
| 437 |
435 screen_position_controller_.reset(new internal::ScreenPositionController); | 438 screen_position_controller_.reset(new internal::ScreenPositionController); |
436 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); | 439 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); |
437 display_controller_.reset(new DisplayController); | 440 display_controller_.reset(new DisplayController); |
438 display_controller_->InitPrimaryDisplay(); | 441 display_controller_->InitPrimaryDisplay(); |
439 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); | 442 aura::RootWindow* root_window = display_controller_->GetPrimaryRootWindow(); |
440 active_root_window_ = root_window; | 443 active_root_window_ = root_window; |
441 | 444 |
442 cursor_manager_.SetDeviceScaleFactor( | 445 cursor_manager_.SetDeviceScaleFactor( |
443 root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor()); | 446 root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor()); |
444 | 447 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 835 |
833 void Shell::DoInitialWorkspaceAnimation() { | 836 void Shell::DoInitialWorkspaceAnimation() { |
834 return GetPrimaryRootWindowController()->workspace_controller()-> | 837 return GetPrimaryRootWindowController()->workspace_controller()-> |
835 DoInitialAnimation(); | 838 DoInitialAnimation(); |
836 } | 839 } |
837 | 840 |
838 aura::client::StackingClient* Shell::stacking_client() { | 841 aura::client::StackingClient* Shell::stacking_client() { |
839 return stacking_client_.get(); | 842 return stacking_client_.get(); |
840 } | 843 } |
841 | 844 |
| 845 message_center::MessageCenter* Shell::message_center() { |
| 846 return message_center_.get(); |
| 847 } |
| 848 |
842 void Shell::InitRootWindowController( | 849 void Shell::InitRootWindowController( |
843 internal::RootWindowController* controller) { | 850 internal::RootWindowController* controller) { |
844 aura::RootWindow* root_window = controller->root_window(); | 851 aura::RootWindow* root_window = controller->root_window(); |
845 DCHECK(activation_client_); | 852 DCHECK(activation_client_); |
846 DCHECK(visibility_controller_.get()); | 853 DCHECK(visibility_controller_.get()); |
847 DCHECK(drag_drop_controller_.get()); | 854 DCHECK(drag_drop_controller_.get()); |
848 DCHECK(capture_controller_.get()); | 855 DCHECK(capture_controller_.get()); |
849 DCHECK(window_cycle_controller_.get()); | 856 DCHECK(window_cycle_controller_.get()); |
850 | 857 |
851 aura::client::SetFocusClient(root_window, focus_client_.get()); | 858 aura::client::SetFocusClient(root_window, focus_client_.get()); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 //////////////////////////////////////////////////////////////////////////////// | 930 //////////////////////////////////////////////////////////////////////////////// |
924 // Shell, aura::client::ActivationChangeObserver implementation: | 931 // Shell, aura::client::ActivationChangeObserver implementation: |
925 | 932 |
926 void Shell::OnWindowActivated(aura::Window* gained_active, | 933 void Shell::OnWindowActivated(aura::Window* gained_active, |
927 aura::Window* lost_active) { | 934 aura::Window* lost_active) { |
928 if (gained_active) | 935 if (gained_active) |
929 active_root_window_ = gained_active->GetRootWindow(); | 936 active_root_window_ = gained_active->GetRootWindow(); |
930 } | 937 } |
931 | 938 |
932 } // namespace ash | 939 } // namespace ash |
OLD | NEW |