| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
| 113 #if defined(USE_X11) | 113 #if defined(USE_X11) |
| 114 #include "ui/gfx/x/x11_types.h" // nogncheck | 114 #include "ui/gfx/x/x11_types.h" // nogncheck |
| 115 #endif // defined(USE_X11) | 115 #endif // defined(USE_X11) |
| 116 #include "ash/accelerators/magnifier_key_scroller.h" | 116 #include "ash/accelerators/magnifier_key_scroller.h" |
| 117 #include "ash/accelerators/spoken_feedback_toggler.h" | 117 #include "ash/accelerators/spoken_feedback_toggler.h" |
| 118 #include "ash/common/ash_constants.h" | 118 #include "ash/common/ash_constants.h" |
| 119 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller
.h" | 119 #include "ash/common/system/chromeos/bluetooth/bluetooth_notification_controller
.h" |
| 120 #include "ash/common/system/chromeos/power/power_status.h" | 120 #include "ash/common/system/chromeos/power/power_status.h" |
| 121 #include "ash/display/ash_display_string_provider.h" |
| 121 #include "ash/display/display_change_observer_chromeos.h" | 122 #include "ash/display/display_change_observer_chromeos.h" |
| 122 #include "ash/display/display_color_manager_chromeos.h" | 123 #include "ash/display/display_color_manager_chromeos.h" |
| 123 #include "ash/display/display_error_observer_chromeos.h" | 124 #include "ash/display/display_error_observer_chromeos.h" |
| 124 #include "ash/display/projecting_observer_chromeos.h" | 125 #include "ash/display/projecting_observer_chromeos.h" |
| 125 #include "ash/display/resolution_notification_controller.h" | 126 #include "ash/display/resolution_notification_controller.h" |
| 126 #include "ash/display/screen_orientation_controller_chromeos.h" | 127 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 128 #include "ash/display/shutdown_observer_chromeos.h" |
| 127 #include "ash/sticky_keys/sticky_keys_controller.h" | 129 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 128 #include "ash/system/chromeos/power/power_event_observer.h" | 130 #include "ash/system/chromeos/power/power_event_observer.h" |
| 129 #include "ash/system/chromeos/power/video_activity_notifier.h" | 131 #include "ash/system/chromeos/power/video_activity_notifier.h" |
| 130 #include "ash/touch/touch_transformer_controller.h" | 132 #include "ash/touch/touch_transformer_controller.h" |
| 131 #include "ash/virtual_keyboard_controller.h" | 133 #include "ash/virtual_keyboard_controller.h" |
| 132 #include "base/bind_helpers.h" | 134 #include "base/bind_helpers.h" |
| 133 #include "base/sys_info.h" | 135 #include "base/sys_info.h" |
| 134 #include "chromeos/audio/audio_a11y_controller.h" | 136 #include "chromeos/audio/audio_a11y_controller.h" |
| 135 #include "chromeos/chromeos_switches.h" | 137 #include "chromeos/chromeos_switches.h" |
| 136 #include "chromeos/dbus/dbus_thread_manager.h" | 138 #include "chromeos/dbus/dbus_thread_manager.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 display_color_manager_.reset(); | 555 display_color_manager_.reset(); |
| 554 if (display_change_observer_) | 556 if (display_change_observer_) |
| 555 display_configurator_->RemoveObserver(display_change_observer_.get()); | 557 display_configurator_->RemoveObserver(display_change_observer_.get()); |
| 556 if (display_error_observer_) | 558 if (display_error_observer_) |
| 557 display_configurator_->RemoveObserver(display_error_observer_.get()); | 559 display_configurator_->RemoveObserver(display_error_observer_.get()); |
| 558 if (projecting_observer_) { | 560 if (projecting_observer_) { |
| 559 display_configurator_->RemoveObserver(projecting_observer_.get()); | 561 display_configurator_->RemoveObserver(projecting_observer_.get()); |
| 560 wm_shell_->RemoveShellObserver(projecting_observer_.get()); | 562 wm_shell_->RemoveShellObserver(projecting_observer_.get()); |
| 561 } | 563 } |
| 562 display_change_observer_.reset(); | 564 display_change_observer_.reset(); |
| 565 shutdown_observer_.reset(); |
| 563 | 566 |
| 564 PowerStatus::Shutdown(); | 567 PowerStatus::Shutdown(); |
| 565 | 568 |
| 566 // Ensure that DBusThreadManager outlives this Shell. | 569 // Ensure that DBusThreadManager outlives this Shell. |
| 567 DCHECK(chromeos::DBusThreadManager::IsInitialized()); | 570 DCHECK(chromeos::DBusThreadManager::IsInitialized()); |
| 568 #endif | 571 #endif |
| 569 | 572 |
| 570 // Needs to happen right before |instance_| is reset. | 573 // Needs to happen right before |instance_| is reset. |
| 571 wm_shell_.reset(); | 574 wm_shell_.reset(); |
| 572 | 575 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 618 |
| 616 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. | 619 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. |
| 617 chromeos::DBusThreadManager* dbus_thread_manager = | 620 chromeos::DBusThreadManager* dbus_thread_manager = |
| 618 chromeos::DBusThreadManager::Get(); | 621 chromeos::DBusThreadManager::Get(); |
| 619 projecting_observer_.reset( | 622 projecting_observer_.reset( |
| 620 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); | 623 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); |
| 621 display_configurator_->AddObserver(projecting_observer_.get()); | 624 display_configurator_->AddObserver(projecting_observer_.get()); |
| 622 wm_shell_->AddShellObserver(projecting_observer_.get()); | 625 wm_shell_->AddShellObserver(projecting_observer_.get()); |
| 623 | 626 |
| 624 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { | 627 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { |
| 625 display_change_observer_.reset(new DisplayChangeObserver); | 628 display_change_observer_ = base::MakeUnique<DisplayChangeObserver>( |
| 629 base::MakeUnique<AshDisplayStringProvider>()); |
| 630 display_change_observer_->set_display_configurator( |
| 631 display_configurator_.get()); |
| 632 display_change_observer_->set_display_manager(display_manager_.get()); |
| 633 |
| 634 shutdown_observer_ = |
| 635 base::MakeUnique<ShutdownObserver>(display_configurator_.get()); |
| 636 |
| 626 // Register |display_change_observer_| first so that the rest of | 637 // Register |display_change_observer_| first so that the rest of |
| 627 // observer gets invoked after the root windows are configured. | 638 // observer gets invoked after the root windows are configured. |
| 628 display_configurator_->AddObserver(display_change_observer_.get()); | 639 display_configurator_->AddObserver(display_change_observer_.get()); |
| 629 display_error_observer_.reset(new DisplayErrorObserver()); | 640 display_error_observer_.reset(new DisplayErrorObserver()); |
| 630 display_configurator_->AddObserver(display_error_observer_.get()); | 641 display_configurator_->AddObserver(display_error_observer_.get()); |
| 631 display_configurator_->set_state_controller(display_change_observer_.get()); | 642 display_configurator_->set_state_controller(display_change_observer_.get()); |
| 632 display_configurator_->set_mirroring_controller(display_manager_.get()); | 643 display_configurator_->set_mirroring_controller(display_manager_.get()); |
| 633 display_configurator_->ForceInitialConfigure( | 644 display_configurator_->ForceInitialConfigure( |
| 634 base::CommandLine::ForCurrentProcess()->HasSwitch( | 645 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 635 chromeos::switches::kFirstExecAfterBoot) | 646 chromeos::switches::kFirstExecAfterBoot) |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 909 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
| 899 return std::unique_ptr<ui::EventTargetIterator>(); | 910 return std::unique_ptr<ui::EventTargetIterator>(); |
| 900 } | 911 } |
| 901 | 912 |
| 902 ui::EventTargeter* Shell::GetEventTargeter() { | 913 ui::EventTargeter* Shell::GetEventTargeter() { |
| 903 NOTREACHED(); | 914 NOTREACHED(); |
| 904 return nullptr; | 915 return nullptr; |
| 905 } | 916 } |
| 906 | 917 |
| 907 } // namespace ash | 918 } // namespace ash |
| OLD | NEW |