| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 #if !defined(OS_MACOSX) | 87 #if !defined(OS_MACOSX) |
| 88 #include "ash/accelerators/accelerator_controller.h" | 88 #include "ash/accelerators/accelerator_controller.h" |
| 89 #include "ash/accelerators/accelerator_filter.h" | 89 #include "ash/accelerators/accelerator_filter.h" |
| 90 #include "ash/accelerators/nested_dispatcher_controller.h" | 90 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
| 94 #include "ash/display/output_configurator_animation.h" | 94 #include "ash/display/output_configurator_animation.h" |
| 95 #include "base/message_pump_aurax11.h" | 95 #include "base/message_pump_aurax11.h" |
| 96 #include "chromeos/display/output_configurator.h" | 96 #include "chromeos/display/output_configurator.h" |
| 97 #include "content/public/browser/gpu_data_manager.h" |
| 98 #include "content/public/common/gpu_feature_type.h" |
| 97 #endif // defined(OS_CHROMEOS) | 99 #endif // defined(OS_CHROMEOS) |
| 98 | 100 |
| 99 namespace ash { | 101 namespace ash { |
| 100 | 102 |
| 101 namespace { | 103 namespace { |
| 102 | 104 |
| 103 using aura::Window; | 105 using aura::Window; |
| 104 using views::Widget; | 106 using views::Widget; |
| 105 | 107 |
| 106 // This dummy class is used for shell unit tests. We dont have chrome delegate | 108 // This dummy class is used for shell unit tests. We dont have chrome delegate |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 #if defined(OS_CHROMEOS) | 184 #if defined(OS_CHROMEOS) |
| 183 output_configurator_(new chromeos::OutputConfigurator()), | 185 output_configurator_(new chromeos::OutputConfigurator()), |
| 184 output_configurator_animation_( | 186 output_configurator_animation_( |
| 185 new internal::OutputConfiguratorAnimation()), | 187 new internal::OutputConfiguratorAnimation()), |
| 186 #endif // defined(OS_CHROMEOS) | 188 #endif // defined(OS_CHROMEOS) |
| 187 browser_context_(NULL) { | 189 browser_context_(NULL) { |
| 188 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); | 190 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); |
| 189 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); | 191 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); |
| 190 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 192 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); |
| 191 #if defined(OS_CHROMEOS) | 193 #if defined(OS_CHROMEOS) |
| 194 content::GpuFeatureType blacklisted_features = |
| 195 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 196 bool is_panel_fitting_disabled = |
| 197 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || |
| 198 CommandLine::ForCurrentProcess()->HasSwitch( |
| 199 switches::kAshDisablePanelFitting); |
| 200 output_configurator_->Init(!is_panel_fitting_disabled); |
| 201 |
| 192 output_configurator_->AddObserver(output_configurator_animation_.get()); | 202 output_configurator_->AddObserver(output_configurator_animation_.get()); |
| 193 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( | 203 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( |
| 194 output_configurator()); | 204 output_configurator()); |
| 195 #endif // defined(OS_CHROMEOS) | 205 #endif // defined(OS_CHROMEOS) |
| 196 } | 206 } |
| 197 | 207 |
| 198 Shell::~Shell() { | 208 Shell::~Shell() { |
| 199 views::FocusManagerFactory::Install(NULL); | 209 views::FocusManagerFactory::Install(NULL); |
| 200 | 210 |
| 201 // Remove the focus from any window. This will prevent overhead and side | 211 // Remove the focus from any window. This will prevent overhead and side |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 iter != controllers.end(); ++iter) { | 758 iter != controllers.end(); ++iter) { |
| 749 if ((*iter)->GetSystemModalLayoutManager(window)-> | 759 if ((*iter)->GetSystemModalLayoutManager(window)-> |
| 750 CanWindowReceiveEvents(window)) { | 760 CanWindowReceiveEvents(window)) { |
| 751 return true; | 761 return true; |
| 752 } | 762 } |
| 753 } | 763 } |
| 754 return false; | 764 return false; |
| 755 } | 765 } |
| 756 | 766 |
| 757 } // namespace ash | 767 } // namespace ash |
| OLD | NEW |