Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 #include "base/bind.h" | 68 #include "base/bind.h" |
| 69 #include "base/command_line.h" | 69 #include "base/command_line.h" |
| 70 #include "base/debug/leak_annotations.h" | 70 #include "base/debug/leak_annotations.h" |
| 71 #include "ui/aura/client/aura_constants.h" | 71 #include "ui/aura/client/aura_constants.h" |
| 72 #include "ui/aura/client/stacking_client.h" | 72 #include "ui/aura/client/stacking_client.h" |
| 73 #include "ui/aura/client/user_action_client.h" | 73 #include "ui/aura/client/user_action_client.h" |
| 74 #include "ui/aura/env.h" | 74 #include "ui/aura/env.h" |
| 75 #include "ui/aura/focus_manager.h" | 75 #include "ui/aura/focus_manager.h" |
| 76 #include "ui/aura/layout_manager.h" | 76 #include "ui/aura/layout_manager.h" |
| 77 #include "ui/aura/root_window.h" | 77 #include "ui/aura/root_window.h" |
| 78 #include "ui/aura/ui_controls_aura.h" | |
| 79 #include "ui/aura/window.h" | 78 #include "ui/aura/window.h" |
| 80 #include "ui/compositor/layer.h" | 79 #include "ui/compositor/layer.h" |
| 81 #include "ui/compositor/layer_animator.h" | 80 #include "ui/compositor/layer_animator.h" |
| 82 #include "ui/gfx/display.h" | 81 #include "ui/gfx/display.h" |
| 83 #include "ui/gfx/image/image_skia.h" | 82 #include "ui/gfx/image/image_skia.h" |
| 84 #include "ui/gfx/screen.h" | 83 #include "ui/gfx/screen.h" |
| 85 #include "ui/gfx/size.h" | 84 #include "ui/gfx/size.h" |
| 86 #include "ui/ui_controls/ui_controls.h" | 85 #include "ui/ui_controls/ui_controls.h" |
| 87 #include "ui/views/corewm/compound_event_filter.h" | 86 #include "ui/views/corewm/compound_event_filter.h" |
| 88 #include "ui/views/corewm/input_method_event_filter.h" | 87 #include "ui/views/corewm/input_method_event_filter.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 new internal::OutputConfiguratorAnimation()), | 202 new internal::OutputConfiguratorAnimation()), |
| 204 #endif // defined(OS_CHROMEOS) | 203 #endif // defined(OS_CHROMEOS) |
| 205 browser_context_(NULL), | 204 browser_context_(NULL), |
| 206 simulate_modal_window_open_for_testing_(false) { | 205 simulate_modal_window_open_for_testing_(false) { |
| 207 DCHECK(delegate_.get()); | 206 DCHECK(delegate_.get()); |
| 208 display_manager_.reset(new internal::DisplayManager); | 207 display_manager_.reset(new internal::DisplayManager); |
| 209 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 | 208 ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466 |
| 210 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); | 209 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); |
| 211 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) | 210 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) |
| 212 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); | 211 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); |
| 213 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 212 ui_controls::UIControls::SetUIControlsInstance( |
| 213 ui_controls::UI_CONTROLS_TYPE_ALTERNATE, internal::CreateUIControls()); | |
|
Ben Goodger (Google)
2012/11/19 20:21:13
4-space indent
| |
| 214 #if defined(OS_CHROMEOS) | 214 #if defined(OS_CHROMEOS) |
| 215 content::GpuFeatureType blacklisted_features = | 215 content::GpuFeatureType blacklisted_features = |
| 216 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); | 216 content::GpuDataManager::GetInstance()->GetBlacklistedFeatures(); |
| 217 bool is_panel_fitting_disabled = | 217 bool is_panel_fitting_disabled = |
| 218 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || | 218 (blacklisted_features & content::GPU_FEATURE_TYPE_PANEL_FITTING) || |
| 219 CommandLine::ForCurrentProcess()->HasSwitch( | 219 CommandLine::ForCurrentProcess()->HasSwitch( |
| 220 switches::kAshDisablePanelFitting); | 220 switches::kAshDisablePanelFitting); |
| 221 output_configurator_->Init(!is_panel_fitting_disabled); | 221 output_configurator_->Init(!is_panel_fitting_disabled); |
| 222 | 222 |
| 223 output_configurator_->AddObserver(output_configurator_animation_.get()); | 223 output_configurator_->AddObserver(output_configurator_animation_.get()); |
| 224 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( | 224 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( |
| 225 output_configurator()); | 225 output_configurator()); |
| 226 #endif // defined(OS_CHROMEOS) | 226 #endif // defined(OS_CHROMEOS) |
| 227 } | 227 } |
| 228 | 228 |
| 229 Shell::~Shell() { | 229 Shell::~Shell() { |
| 230 views::FocusManagerFactory::Install(NULL); | 230 views::FocusManagerFactory::Install(NULL); |
| 231 ui_controls::UIControls::SetUIControlsInstance( | |
| 232 ui_controls::UI_CONTROLS_TYPE_ALTERNATE, NULL); | |
| 231 | 233 |
| 232 // Remove the focus from any window. This will prevent overhead and side | 234 // Remove the focus from any window. This will prevent overhead and side |
| 233 // effects (e.g. crashes) from changing focus during shutdown. | 235 // effects (e.g. crashes) from changing focus during shutdown. |
| 234 // See bug crbug.com/134502. | 236 // See bug crbug.com/134502. |
| 235 if (active_root_window_) | 237 if (active_root_window_) |
| 236 active_root_window_->GetFocusManager()->SetFocusedWindow(NULL, NULL); | 238 active_root_window_->GetFocusManager()->SetFocusedWindow(NULL, NULL); |
| 237 | 239 |
| 238 // Please keep in same order as in Init() because it's easy to miss one. | 240 // Please keep in same order as in Init() because it's easy to miss one. |
| 239 RemovePreTargetHandler(user_activity_detector_.get()); | 241 RemovePreTargetHandler(user_activity_detector_.get()); |
| 240 RemovePreTargetHandler(event_rewriter_filter_.get()); | 242 RemovePreTargetHandler(event_rewriter_filter_.get()); |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 857 | 859 |
| 858 bool Shell::CanAcceptEvents() { | 860 bool Shell::CanAcceptEvents() { |
| 859 return true; | 861 return true; |
| 860 } | 862 } |
| 861 | 863 |
| 862 ui::EventTarget* Shell::GetParentTarget() { | 864 ui::EventTarget* Shell::GetParentTarget() { |
| 863 return NULL; | 865 return NULL; |
| 864 } | 866 } |
| 865 | 867 |
| 866 } // namespace ash | 868 } // namespace ash |
| OLD | NEW |