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" |
11 #include "ash/ash_switches.h" | 11 #include "ash/ash_switches.h" |
12 #include "ash/caps_lock_delegate.h" | 12 #include "ash/caps_lock_delegate.h" |
13 #include "ash/desktop_background/desktop_background_controller.h" | 13 #include "ash/desktop_background/desktop_background_controller.h" |
14 #include "ash/desktop_background/desktop_background_view.h" | 14 #include "ash/desktop_background/desktop_background_view.h" |
15 #include "ash/desktop_background/user_wallpaper_delegate.h" | 15 #include "ash/desktop_background/user_wallpaper_delegate.h" |
16 #include "ash/display/display_controller.h" | 16 #include "ash/display/display_controller.h" |
17 #include "ash/display/display_manager.h" | 17 #include "ash/display/display_manager.h" |
18 #include "ash/display/mouse_cursor_event_filter.h" | 18 #include "ash/display/mouse_cursor_event_filter.h" |
19 #include "ash/display/screen_position_controller.h" | 19 #include "ash/display/screen_position_controller.h" |
20 #include "ash/drag_drop/drag_drop_controller.h" | 20 #include "ash/drag_drop/drag_drop_controller.h" |
21 #include "ash/focus_cycler.h" | 21 #include "ash/focus_cycler.h" |
22 #include "ash/high_contrast/high_contrast_controller.h" | 22 #include "ash/high_contrast/high_contrast_controller.h" |
23 #include "ash/magnifier/magnification_controller.h" | 23 #include "ash/magnifier/magnification_controller.h" |
24 #include "ash/magnifier/partial_magnification_controller.h" | 24 #include "ash/magnifier/partial_magnification_controller.h" |
25 #include "ash/root_window_controller.h" | 25 #include "ash/root_window_controller.h" |
| 26 #include "ash/root_window_delegate.h" |
26 #include "ash/screen_ash.h" | 27 #include "ash/screen_ash.h" |
27 #include "ash/shell_delegate.h" | 28 #include "ash/shell_delegate.h" |
28 #include "ash/shell_factory.h" | 29 #include "ash/shell_factory.h" |
29 #include "ash/shell_window_ids.h" | 30 #include "ash/shell_window_ids.h" |
30 #include "ash/system/status_area_widget.h" | 31 #include "ash/system/status_area_widget.h" |
31 #include "ash/system/tray/system_tray_delegate.h" | 32 #include "ash/system/tray/system_tray_delegate.h" |
32 #include "ash/system/tray/system_tray_notifier.h" | 33 #include "ash/system/tray/system_tray_notifier.h" |
33 #include "ash/tooltips/tooltip_controller.h" | 34 #include "ash/tooltips/tooltip_controller.h" |
34 #include "ash/touch/touch_observer_hud.h" | 35 #include "ash/touch/touch_observer_hud.h" |
35 #include "ash/wm/activation_controller.h" | 36 #include "ash/wm/activation_controller.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 delegate_(delegate), | 194 delegate_(delegate), |
194 activation_client_(NULL), | 195 activation_client_(NULL), |
195 #if defined(OS_CHROMEOS) | 196 #if defined(OS_CHROMEOS) |
196 output_configurator_(new chromeos::OutputConfigurator()), | 197 output_configurator_(new chromeos::OutputConfigurator()), |
197 output_configurator_animation_( | 198 output_configurator_animation_( |
198 new internal::OutputConfiguratorAnimation()), | 199 new internal::OutputConfiguratorAnimation()), |
199 #endif // defined(OS_CHROMEOS) | 200 #endif // defined(OS_CHROMEOS) |
200 browser_context_(NULL), | 201 browser_context_(NULL), |
201 simulate_modal_window_open_for_testing_(false) { | 202 simulate_modal_window_open_for_testing_(false) { |
202 DCHECK(delegate_.get()); | 203 DCHECK(delegate_.get()); |
203 display_manager_.reset(new internal::DisplayManager); | 204 display_manager_.reset(new internal::DisplayManager(this)); |
204 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 | 205 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 |
205 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); | 206 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); |
206 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) | 207 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) |
207 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); | 208 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); |
208 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 209 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); |
209 #if defined(OS_CHROMEOS) | 210 #if defined(OS_CHROMEOS) |
210 content::GpuFeatureType blacklisted_features = | 211 content::GpuFeatureType blacklisted_features = |
211 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 212 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
212 bool is_panel_fitting_disabled = | 213 bool is_panel_fitting_disabled = |
213 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || | 214 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 } | 874 } |
874 | 875 |
875 void Shell::OnEvent(ui::Event* event) { | 876 void Shell::OnEvent(ui::Event* event) { |
876 if (event->type() == | 877 if (event->type() == |
877 views::corewm::FocusChangeEvent::activation_changed_event_type()) { | 878 views::corewm::FocusChangeEvent::activation_changed_event_type()) { |
878 active_root_window_ = | 879 active_root_window_ = |
879 static_cast<aura::Window*>(event->target())->GetRootWindow(); | 880 static_cast<aura::Window*>(event->target())->GetRootWindow(); |
880 } | 881 } |
881 } | 882 } |
882 | 883 |
| 884 //////////////////////////////////////////////////////////////////////////////// |
| 885 // Shell, ash::internal::DisplayManagerDelegate overrides: |
| 886 |
| 887 aura::RootWindowDelegate* Shell::CreateRootWindowDelegate() { |
| 888 return delegate_->CreateRootWindowDelegate(); |
| 889 } |
| 890 |
883 } // namespace ash | 891 } // namespace ash |
OLD | NEW |