| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 #include "ash/accelerators/nested_dispatcher_controller.h" | 109 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
| 113 #if defined(USE_X11) | 113 #if defined(USE_X11) |
| 114 #include "ash/ash_constants.h" | 114 #include "ash/ash_constants.h" |
| 115 #include "ash/display/display_change_observer_chromeos.h" | 115 #include "ash/display/display_change_observer_chromeos.h" |
| 116 #include "ash/display/display_error_observer_chromeos.h" | 116 #include "ash/display/display_error_observer_chromeos.h" |
| 117 #include "ash/display/output_configurator_animation.h" | 117 #include "ash/display/output_configurator_animation.h" |
| 118 #include "base/chromeos/chromeos_version.h" | 118 #include "base/chromeos/chromeos_version.h" |
| 119 #include "base/message_loop/message_pump_aurax11.h" | 119 #include "base/message_loop/message_pump_x11.h" |
| 120 #include "chromeos/display/output_configurator.h" | 120 #include "chromeos/display/output_configurator.h" |
| 121 #include "content/public/browser/gpu_data_manager.h" | 121 #include "content/public/browser/gpu_data_manager.h" |
| 122 #include "gpu/config/gpu_feature_type.h" | 122 #include "gpu/config/gpu_feature_type.h" |
| 123 #endif // defined(USE_X11) | 123 #endif // defined(USE_X11) |
| 124 #include "ash/system/chromeos/power/power_status.h" | 124 #include "ash/system/chromeos/power/power_status.h" |
| 125 #endif // defined(OS_CHROMEOS) | 125 #endif // defined(OS_CHROMEOS) |
| 126 | 126 |
| 127 namespace ash { | 127 namespace ash { |
| 128 | 128 |
| 129 namespace { | 129 namespace { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) | 223 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) |
| 224 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); | 224 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); |
| 225 display_controller_.reset(new DisplayController); | 225 display_controller_.reset(new DisplayController); |
| 226 #if defined(OS_CHROMEOS) && defined(USE_X11) | 226 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 227 bool is_panel_fitting_disabled = | 227 bool is_panel_fitting_disabled = |
| 228 content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 228 content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
| 229 gpu::GPU_FEATURE_TYPE_PANEL_FITTING); | 229 gpu::GPU_FEATURE_TYPE_PANEL_FITTING); |
| 230 | 230 |
| 231 output_configurator_->Init(!is_panel_fitting_disabled); | 231 output_configurator_->Init(!is_panel_fitting_disabled); |
| 232 | 232 |
| 233 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( | 233 base::MessagePumpX11::Current()->AddDispatcherForRootWindow( |
| 234 output_configurator()); | 234 output_configurator()); |
| 235 // We can't do this with a root window listener because XI_HierarchyChanged | 235 // We can't do this with a root window listener because XI_HierarchyChanged |
| 236 // messages don't have a target window. | 236 // messages don't have a target window. |
| 237 base::MessagePumpAuraX11::Current()->AddObserver(output_configurator()); | 237 base::MessagePumpX11::Current()->AddObserver(output_configurator()); |
| 238 #endif // defined(OS_CHROMEOS) | 238 #endif // defined(OS_CHROMEOS) |
| 239 AddPreTargetHandler(this); | 239 AddPreTargetHandler(this); |
| 240 | 240 |
| 241 #if defined(OS_CHROMEOS) | 241 #if defined(OS_CHROMEOS) |
| 242 internal::PowerStatus::Initialize(); | 242 internal::PowerStatus::Initialize(); |
| 243 #endif | 243 #endif |
| 244 } | 244 } |
| 245 | 245 |
| 246 Shell::~Shell() { | 246 Shell::~Shell() { |
| 247 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); | 247 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 display_controller_.reset(); | 322 display_controller_.reset(); |
| 323 screen_position_controller_.reset(); | 323 screen_position_controller_.reset(); |
| 324 | 324 |
| 325 #if defined(OS_CHROMEOS) && defined(USE_X11) | 325 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 326 if (display_change_observer_) | 326 if (display_change_observer_) |
| 327 output_configurator_->RemoveObserver(display_change_observer_.get()); | 327 output_configurator_->RemoveObserver(display_change_observer_.get()); |
| 328 if (output_configurator_animation_) | 328 if (output_configurator_animation_) |
| 329 output_configurator_->RemoveObserver(output_configurator_animation_.get()); | 329 output_configurator_->RemoveObserver(output_configurator_animation_.get()); |
| 330 if (display_error_observer_) | 330 if (display_error_observer_) |
| 331 output_configurator_->RemoveObserver(display_error_observer_.get()); | 331 output_configurator_->RemoveObserver(display_error_observer_.get()); |
| 332 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow( | 332 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow( |
| 333 output_configurator()); | 333 output_configurator()); |
| 334 base::MessagePumpAuraX11::Current()->RemoveObserver(output_configurator()); | 334 base::MessagePumpX11::Current()->RemoveObserver(output_configurator()); |
| 335 display_change_observer_.reset(); | 335 display_change_observer_.reset(); |
| 336 #endif // defined(OS_CHROMEOS) | 336 #endif // defined(OS_CHROMEOS) |
| 337 | 337 |
| 338 #if defined(OS_CHROMEOS) | 338 #if defined(OS_CHROMEOS) |
| 339 internal::PowerStatus::Shutdown(); | 339 internal::PowerStatus::Shutdown(); |
| 340 #endif | 340 #endif |
| 341 | 341 |
| 342 DCHECK(instance_ == this); | 342 DCHECK(instance_ == this); |
| 343 instance_ = NULL; | 343 instance_ = NULL; |
| 344 } | 344 } |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 //////////////////////////////////////////////////////////////////////////////// | 967 //////////////////////////////////////////////////////////////////////////////// |
| 968 // Shell, aura::client::ActivationChangeObserver implementation: | 968 // Shell, aura::client::ActivationChangeObserver implementation: |
| 969 | 969 |
| 970 void Shell::OnWindowActivated(aura::Window* gained_active, | 970 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 971 aura::Window* lost_active) { | 971 aura::Window* lost_active) { |
| 972 if (gained_active) | 972 if (gained_active) |
| 973 target_root_window_ = gained_active->GetRootWindow(); | 973 target_root_window_ = gained_active->GetRootWindow(); |
| 974 } | 974 } |
| 975 | 975 |
| 976 } // namespace ash | 976 } // namespace ash |
| OLD | NEW |