| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/display_change_observer_chromeos.h" | 121 #include "ash/display/display_change_observer_chromeos.h" |
| 122 #include "ash/display/display_color_manager_chromeos.h" | 122 #include "ash/display/display_color_manager_chromeos.h" |
| 123 #include "ash/display/display_error_observer_chromeos.h" | 123 #include "ash/display/display_error_observer_chromeos.h" |
| 124 #include "ash/display/projecting_observer_chromeos.h" | 124 #include "ash/display/projecting_observer_chromeos.h" |
| 125 #include "ash/display/resolution_notification_controller.h" | 125 #include "ash/display/resolution_notification_controller.h" |
| 126 #include "ash/display/screen_orientation_controller_chromeos.h" | 126 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 127 #include "ash/display/shutdown_observer_chromeos.h" |
| 127 #include "ash/sticky_keys/sticky_keys_controller.h" | 128 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 128 #include "ash/system/chromeos/power/power_event_observer.h" | 129 #include "ash/system/chromeos/power/power_event_observer.h" |
| 129 #include "ash/system/chromeos/power/video_activity_notifier.h" | 130 #include "ash/system/chromeos/power/video_activity_notifier.h" |
| 130 #include "ash/touch/touch_transformer_controller.h" | 131 #include "ash/touch/touch_transformer_controller.h" |
| 131 #include "ash/virtual_keyboard_controller.h" | 132 #include "ash/virtual_keyboard_controller.h" |
| 132 #include "base/bind_helpers.h" | 133 #include "base/bind_helpers.h" |
| 133 #include "base/sys_info.h" | 134 #include "base/sys_info.h" |
| 134 #include "chromeos/audio/audio_a11y_controller.h" | 135 #include "chromeos/audio/audio_a11y_controller.h" |
| 135 #include "chromeos/chromeos_switches.h" | 136 #include "chromeos/chromeos_switches.h" |
| 136 #include "chromeos/dbus/dbus_thread_manager.h" | 137 #include "chromeos/dbus/dbus_thread_manager.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 display_color_manager_.reset(); | 552 display_color_manager_.reset(); |
| 552 if (display_change_observer_) | 553 if (display_change_observer_) |
| 553 display_configurator_->RemoveObserver(display_change_observer_.get()); | 554 display_configurator_->RemoveObserver(display_change_observer_.get()); |
| 554 if (display_error_observer_) | 555 if (display_error_observer_) |
| 555 display_configurator_->RemoveObserver(display_error_observer_.get()); | 556 display_configurator_->RemoveObserver(display_error_observer_.get()); |
| 556 if (projecting_observer_) { | 557 if (projecting_observer_) { |
| 557 display_configurator_->RemoveObserver(projecting_observer_.get()); | 558 display_configurator_->RemoveObserver(projecting_observer_.get()); |
| 558 wm_shell_->RemoveShellObserver(projecting_observer_.get()); | 559 wm_shell_->RemoveShellObserver(projecting_observer_.get()); |
| 559 } | 560 } |
| 560 display_change_observer_.reset(); | 561 display_change_observer_.reset(); |
| 562 shutdown_observer_.reset(); |
| 561 | 563 |
| 562 PowerStatus::Shutdown(); | 564 PowerStatus::Shutdown(); |
| 563 | 565 |
| 564 // Ensure that DBusThreadManager outlives this Shell. | 566 // Ensure that DBusThreadManager outlives this Shell. |
| 565 DCHECK(chromeos::DBusThreadManager::IsInitialized()); | 567 DCHECK(chromeos::DBusThreadManager::IsInitialized()); |
| 566 #endif | 568 #endif |
| 567 | 569 |
| 568 // Needs to happen right before |instance_| is reset. | 570 // Needs to happen right before |instance_| is reset. |
| 569 wm_shell_.reset(); | 571 wm_shell_.reset(); |
| 570 | 572 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 615 |
| 614 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. | 616 // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell. |
| 615 chromeos::DBusThreadManager* dbus_thread_manager = | 617 chromeos::DBusThreadManager* dbus_thread_manager = |
| 616 chromeos::DBusThreadManager::Get(); | 618 chromeos::DBusThreadManager::Get(); |
| 617 projecting_observer_.reset( | 619 projecting_observer_.reset( |
| 618 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); | 620 new ProjectingObserver(dbus_thread_manager->GetPowerManagerClient())); |
| 619 display_configurator_->AddObserver(projecting_observer_.get()); | 621 display_configurator_->AddObserver(projecting_observer_.get()); |
| 620 wm_shell_->AddShellObserver(projecting_observer_.get()); | 622 wm_shell_->AddShellObserver(projecting_observer_.get()); |
| 621 | 623 |
| 622 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { | 624 if (!display_initialized && base::SysInfo::IsRunningOnChromeOS()) { |
| 623 display_change_observer_.reset(new DisplayChangeObserver); | 625 display_change_observer_ = base::MakeUnique<DisplayChangeObserver>( |
| 626 display_configurator_.get(), display_manager_.get()); |
| 627 |
| 628 shutdown_observer_ = |
| 629 base::MakeUnique<ShutdownObserver>(display_configurator_.get()); |
| 630 |
| 624 // Register |display_change_observer_| first so that the rest of | 631 // Register |display_change_observer_| first so that the rest of |
| 625 // observer gets invoked after the root windows are configured. | 632 // observer gets invoked after the root windows are configured. |
| 626 display_configurator_->AddObserver(display_change_observer_.get()); | 633 display_configurator_->AddObserver(display_change_observer_.get()); |
| 627 display_error_observer_.reset(new DisplayErrorObserver()); | 634 display_error_observer_.reset(new DisplayErrorObserver()); |
| 628 display_configurator_->AddObserver(display_error_observer_.get()); | 635 display_configurator_->AddObserver(display_error_observer_.get()); |
| 629 display_configurator_->set_state_controller(display_change_observer_.get()); | 636 display_configurator_->set_state_controller(display_change_observer_.get()); |
| 630 display_configurator_->set_mirroring_controller(display_manager_.get()); | 637 display_configurator_->set_mirroring_controller(display_manager_.get()); |
| 631 display_configurator_->ForceInitialConfigure( | 638 display_configurator_->ForceInitialConfigure( |
| 632 base::CommandLine::ForCurrentProcess()->HasSwitch( | 639 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 633 chromeos::switches::kFirstExecAfterBoot) | 640 chromeos::switches::kFirstExecAfterBoot) |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 911 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
| 905 return std::unique_ptr<ui::EventTargetIterator>(); | 912 return std::unique_ptr<ui::EventTargetIterator>(); |
| 906 } | 913 } |
| 907 | 914 |
| 908 ui::EventTargeter* Shell::GetEventTargeter() { | 915 ui::EventTargeter* Shell::GetEventTargeter() { |
| 909 NOTREACHED(); | 916 NOTREACHED(); |
| 910 return nullptr; | 917 return nullptr; |
| 911 } | 918 } |
| 912 | 919 |
| 913 } // namespace ash | 920 } // namespace ash |
| OLD | NEW |