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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 #if !defined(OS_MACOSX) | 99 #if !defined(OS_MACOSX) |
100 #include "ash/accelerators/accelerator_controller.h" | 100 #include "ash/accelerators/accelerator_controller.h" |
101 #include "ash/accelerators/accelerator_filter.h" | 101 #include "ash/accelerators/accelerator_filter.h" |
102 #include "ash/accelerators/nested_dispatcher_controller.h" | 102 #include "ash/accelerators/nested_dispatcher_controller.h" |
103 #endif | 103 #endif |
104 | 104 |
105 #if defined(OS_CHROMEOS) | 105 #if defined(OS_CHROMEOS) |
106 #include "ash/ash_constants.h" | 106 #include "ash/ash_constants.h" |
107 #include "ash/display/display_change_observer_x11.h" | 107 #include "ash/display/display_change_observer_x11.h" |
| 108 #include "ash/display/display_error_dialog.h" |
108 #include "ash/display/output_configurator_animation.h" | 109 #include "ash/display/output_configurator_animation.h" |
109 #include "base/chromeos/chromeos_version.h" | 110 #include "base/chromeos/chromeos_version.h" |
110 #include "base/message_pump_aurax11.h" | 111 #include "base/message_pump_aurax11.h" |
111 #include "chromeos/display/output_configurator.h" | 112 #include "chromeos/display/output_configurator.h" |
112 #include "content/public/browser/gpu_data_manager.h" | 113 #include "content/public/browser/gpu_data_manager.h" |
113 #include "content/public/common/content_switches.h" | 114 #include "content/public/common/content_switches.h" |
114 #include "content/public/common/gpu_feature_type.h" | 115 #include "content/public/common/gpu_feature_type.h" |
115 #endif // defined(OS_CHROMEOS) | 116 #endif // defined(OS_CHROMEOS) |
116 | 117 |
117 namespace ash { | 118 namespace ash { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 activation_controller_.reset(); | 298 activation_controller_.reset(); |
298 | 299 |
299 DCHECK(instance_ == this); | 300 DCHECK(instance_ == this); |
300 instance_ = NULL; | 301 instance_ = NULL; |
301 | 302 |
302 #if defined(OS_CHROMEOS) | 303 #if defined(OS_CHROMEOS) |
303 if (display_change_observer_.get()) | 304 if (display_change_observer_.get()) |
304 output_configurator_->RemoveObserver(display_change_observer_.get()); | 305 output_configurator_->RemoveObserver(display_change_observer_.get()); |
305 if (output_configurator_animation_.get()) | 306 if (output_configurator_animation_.get()) |
306 output_configurator_->RemoveObserver(output_configurator_animation_.get()); | 307 output_configurator_->RemoveObserver(output_configurator_animation_.get()); |
| 308 if (display_error_observer_.get()) |
| 309 output_configurator_->RemoveObserver(display_error_observer_.get()); |
307 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow( | 310 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow( |
308 output_configurator()); | 311 output_configurator()); |
309 #endif // defined(OS_CHROMEOS) | 312 #endif // defined(OS_CHROMEOS) |
310 } | 313 } |
311 | 314 |
312 // static | 315 // static |
313 Shell* Shell::CreateInstance(ShellDelegate* delegate) { | 316 Shell* Shell::CreateInstance(ShellDelegate* delegate) { |
314 CHECK(!instance_); | 317 CHECK(!instance_); |
315 instance_ = new Shell(delegate); | 318 instance_ = new Shell(delegate); |
316 instance_->Init(); | 319 instance_->Init(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 407 } |
405 | 408 |
406 void Shell::Init() { | 409 void Shell::Init() { |
407 #if defined(OS_CHROMEOS) | 410 #if defined(OS_CHROMEOS) |
408 if (base::chromeos::IsRunningOnChromeOS()) { | 411 if (base::chromeos::IsRunningOnChromeOS()) { |
409 display_change_observer_.reset(new internal::DisplayChangeObserverX11); | 412 display_change_observer_.reset(new internal::DisplayChangeObserverX11); |
410 // Register |display_change_observer_| first so that the rest of | 413 // Register |display_change_observer_| first so that the rest of |
411 // observer gets invoked after the root windows are configured. | 414 // observer gets invoked after the root windows are configured. |
412 output_configurator_->AddObserver(display_change_observer_.get()); | 415 output_configurator_->AddObserver(display_change_observer_.get()); |
413 output_configurator_animation_.reset( | 416 output_configurator_animation_.reset( |
414 new internal::OutputConfiguratorAnimation()), | 417 new internal::OutputConfiguratorAnimation()); |
| 418 display_error_observer_.reset(new internal::DisplayErrorObserver()); |
415 output_configurator_->AddObserver(output_configurator_animation_.get()); | 419 output_configurator_->AddObserver(output_configurator_animation_.get()); |
| 420 output_configurator_->AddObserver(display_error_observer_.get()); |
416 display_change_observer_->OnDisplayModeChanged(); | 421 display_change_observer_->OnDisplayModeChanged(); |
417 } | 422 } |
418 #endif | 423 #endif |
419 | 424 |
420 // Install the custom factory first so that views::FocusManagers for Tray, | 425 // Install the custom factory first so that views::FocusManagers for Tray, |
421 // Launcher, and WallPaper could be created by the factory. | 426 // Launcher, and WallPaper could be created by the factory. |
422 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 427 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
423 | 428 |
424 env_filter_.reset(new views::corewm::CompoundEventFilter); | 429 env_filter_.reset(new views::corewm::CompoundEventFilter); |
425 AddPreTargetHandler(env_filter_.get()); | 430 AddPreTargetHandler(env_filter_.get()); |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 //////////////////////////////////////////////////////////////////////////////// | 941 //////////////////////////////////////////////////////////////////////////////// |
937 // Shell, aura::client::ActivationChangeObserver implementation: | 942 // Shell, aura::client::ActivationChangeObserver implementation: |
938 | 943 |
939 void Shell::OnWindowActivated(aura::Window* gained_active, | 944 void Shell::OnWindowActivated(aura::Window* gained_active, |
940 aura::Window* lost_active) { | 945 aura::Window* lost_active) { |
941 if (gained_active) | 946 if (gained_active) |
942 active_root_window_ = gained_active->GetRootWindow(); | 947 active_root_window_ = gained_active->GetRootWindow(); |
943 } | 948 } |
944 | 949 |
945 } // namespace ash | 950 } // namespace ash |
OLD | NEW |