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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 #if !defined(OS_MACOSX) | 106 #if !defined(OS_MACOSX) |
107 #include "ash/accelerators/accelerator_controller.h" | 107 #include "ash/accelerators/accelerator_controller.h" |
108 #include "ash/accelerators/accelerator_filter.h" | 108 #include "ash/accelerators/accelerator_filter.h" |
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_x11.h" | 115 #include "ash/display/display_change_observer_chromeos.h" |
116 #include "ash/display/display_error_observer.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_aurax11.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 "content/public/common/content_switches.h" | 122 #include "content/public/common/content_switches.h" |
123 #include "gpu/config/gpu_feature_type.h" | 123 #include "gpu/config/gpu_feature_type.h" |
124 #endif // defined(USE_X11) | 124 #endif // defined(USE_X11) |
125 #include "ash/system/chromeos/power/power_status.h" | 125 #include "ash/system/chromeos/power/power_status.h" |
126 #endif // defined(OS_CHROMEOS) | 126 #endif // defined(OS_CHROMEOS) |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 void Shell::Init() { | 447 void Shell::Init() { |
448 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 448 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
449 | 449 |
450 delegate_->PreInit(); | 450 delegate_->PreInit(); |
451 bool display_initialized = false; | 451 bool display_initialized = false; |
452 #if defined(OS_CHROMEOS) && defined(USE_X11) | 452 #if defined(OS_CHROMEOS) && defined(USE_X11) |
453 output_configurator_animation_.reset( | 453 output_configurator_animation_.reset( |
454 new internal::OutputConfiguratorAnimation()); | 454 new internal::OutputConfiguratorAnimation()); |
455 output_configurator_->AddObserver(output_configurator_animation_.get()); | 455 output_configurator_->AddObserver(output_configurator_animation_.get()); |
456 if (base::chromeos::IsRunningOnChromeOS()) { | 456 if (base::chromeos::IsRunningOnChromeOS()) { |
457 display_change_observer_.reset(new internal::DisplayChangeObserverX11); | 457 display_change_observer_.reset(new internal::DisplayChangeObserver); |
458 // Register |display_change_observer_| first so that the rest of | 458 // Register |display_change_observer_| first so that the rest of |
459 // observer gets invoked after the root windows are configured. | 459 // observer gets invoked after the root windows are configured. |
460 output_configurator_->AddObserver(display_change_observer_.get()); | 460 output_configurator_->AddObserver(display_change_observer_.get()); |
461 display_error_observer_.reset(new internal::DisplayErrorObserver()); | 461 display_error_observer_.reset(new internal::DisplayErrorObserver()); |
462 output_configurator_->AddObserver(display_error_observer_.get()); | 462 output_configurator_->AddObserver(display_error_observer_.get()); |
463 output_configurator_->set_state_controller(display_change_observer_.get()); | 463 output_configurator_->set_state_controller(display_change_observer_.get()); |
464 if (!command_line->HasSwitch(ash::switches::kAshDisableSoftwareMirroring)) | 464 if (!command_line->HasSwitch(ash::switches::kAshDisableSoftwareMirroring)) |
465 output_configurator_->set_mirroring_controller(display_manager_.get()); | 465 output_configurator_->set_mirroring_controller(display_manager_.get()); |
466 output_configurator_->Start( | 466 output_configurator_->Start( |
467 delegate_->IsFirstRunAfterBoot() ? kChromeOsBootColor : 0); | 467 delegate_->IsFirstRunAfterBoot() ? kChromeOsBootColor : 0); |
468 display_initialized = true; | 468 display_initialized = true; |
469 } | 469 } |
470 #endif | 470 #endif // defined(OS_CHROMEOS) && defined(USE_X11) |
471 if (!display_initialized) | 471 if (!display_initialized) |
472 display_manager_->InitFromCommandLine(); | 472 display_manager_->InitFromCommandLine(); |
473 | 473 |
474 // Install the custom factory first so that views::FocusManagers for Tray, | 474 // Install the custom factory first so that views::FocusManagers for Tray, |
475 // Launcher, and WallPaper could be created by the factory. | 475 // Launcher, and WallPaper could be created by the factory. |
476 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 476 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
477 | 477 |
478 env_filter_.reset(new views::corewm::CompoundEventFilter); | 478 env_filter_.reset(new views::corewm::CompoundEventFilter); |
479 AddPreTargetHandler(env_filter_.get()); | 479 AddPreTargetHandler(env_filter_.get()); |
480 | 480 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 //////////////////////////////////////////////////////////////////////////////// | 984 //////////////////////////////////////////////////////////////////////////////// |
985 // Shell, aura::client::ActivationChangeObserver implementation: | 985 // Shell, aura::client::ActivationChangeObserver implementation: |
986 | 986 |
987 void Shell::OnWindowActivated(aura::Window* gained_active, | 987 void Shell::OnWindowActivated(aura::Window* gained_active, |
988 aura::Window* lost_active) { | 988 aura::Window* lost_active) { |
989 if (gained_active) | 989 if (gained_active) |
990 target_root_window_ = gained_active->GetRootWindow(); | 990 target_root_window_ = gained_active->GetRootWindow(); |
991 } | 991 } |
992 | 992 |
993 } // namespace ash | 993 } // namespace ash |
OLD | NEW |