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