| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #include "base/bind.h" | 92 #include "base/bind.h" |
| 93 #include "base/bind_helpers.h" | 93 #include "base/bind_helpers.h" |
| 94 #include "base/command_line.h" | 94 #include "base/command_line.h" |
| 95 #include "base/memory/ptr_util.h" | 95 #include "base/memory/ptr_util.h" |
| 96 #include "base/sys_info.h" | 96 #include "base/sys_info.h" |
| 97 #include "base/trace_event/trace_event.h" | 97 #include "base/trace_event/trace_event.h" |
| 98 #include "chromeos/audio/audio_a11y_controller.h" | 98 #include "chromeos/audio/audio_a11y_controller.h" |
| 99 #include "chromeos/chromeos_switches.h" | 99 #include "chromeos/chromeos_switches.h" |
| 100 #include "chromeos/dbus/dbus_thread_manager.h" | 100 #include "chromeos/dbus/dbus_thread_manager.h" |
| 101 #include "chromeos/system/devicemode.h" | 101 #include "chromeos/system/devicemode.h" |
| 102 #include "services/service_manager/public/cpp/connector.h" |
| 103 #include "services/ui/public/interfaces/constants.mojom.h" |
| 102 #include "ui/aura/client/aura_constants.h" | 104 #include "ui/aura/client/aura_constants.h" |
| 103 #include "ui/aura/env.h" | 105 #include "ui/aura/env.h" |
| 104 #include "ui/aura/layout_manager.h" | 106 #include "ui/aura/layout_manager.h" |
| 107 #include "ui/aura/mus/user_activity_forwarder.h" |
| 105 #include "ui/aura/window.h" | 108 #include "ui/aura/window.h" |
| 106 #include "ui/aura/window_event_dispatcher.h" | 109 #include "ui/aura/window_event_dispatcher.h" |
| 107 #include "ui/base/ui_base_switches.h" | 110 #include "ui/base/ui_base_switches.h" |
| 108 #include "ui/base/user_activity/user_activity_detector.h" | 111 #include "ui/base/user_activity/user_activity_detector.h" |
| 109 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 112 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
| 110 #include "ui/compositor/layer.h" | 113 #include "ui/compositor/layer.h" |
| 111 #include "ui/compositor/layer_animator.h" | 114 #include "ui/compositor/layer_animator.h" |
| 112 #include "ui/display/display.h" | 115 #include "ui/display/display.h" |
| 113 #include "ui/display/manager/chromeos/display_change_observer.h" | 116 #include "ui/display/manager/chromeos/display_change_observer.h" |
| 114 #include "ui/display/manager/chromeos/display_configurator.h" | 117 #include "ui/display/manager/chromeos/display_configurator.h" |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 lock_state_controller_ = | 730 lock_state_controller_ = |
| 728 base::MakeUnique<LockStateController>(wm_shell_->shutdown_controller()); | 731 base::MakeUnique<LockStateController>(wm_shell_->shutdown_controller()); |
| 729 power_button_controller_.reset( | 732 power_button_controller_.reset( |
| 730 new PowerButtonController(lock_state_controller_.get())); | 733 new PowerButtonController(lock_state_controller_.get())); |
| 731 // Pass the initial display state to PowerButtonController. | 734 // Pass the initial display state to PowerButtonController. |
| 732 power_button_controller_->OnDisplayModeChanged( | 735 power_button_controller_->OnDisplayModeChanged( |
| 733 display_configurator_->cached_displays()); | 736 display_configurator_->cached_displays()); |
| 734 | 737 |
| 735 wm_shell_->AddShellObserver(lock_state_controller_.get()); | 738 wm_shell_->AddShellObserver(lock_state_controller_.get()); |
| 736 | 739 |
| 740 // The connector is unavailable in some tests. |
| 741 if (is_mash && wm_shell_->delegate()->GetShellConnector()) { |
| 742 ui::mojom::UserActivityMonitorPtr user_activity_monitor; |
| 743 wm_shell_->delegate()->GetShellConnector()->BindInterface( |
| 744 ui::mojom::kServiceName, &user_activity_monitor); |
| 745 user_activity_forwarder_ = base::MakeUnique<aura::UserActivityForwarder>( |
| 746 std::move(user_activity_monitor), user_activity_detector_.get()); |
| 747 } |
| 748 |
| 737 drag_drop_controller_.reset(new DragDropController); | 749 drag_drop_controller_.reset(new DragDropController); |
| 738 // |screenshot_controller_| needs to be created (and prepended as a | 750 // |screenshot_controller_| needs to be created (and prepended as a |
| 739 // pre-target handler) at this point, because |mouse_cursor_filter_| needs to | 751 // pre-target handler) at this point, because |mouse_cursor_filter_| needs to |
| 740 // process mouse events prior to screenshot session. | 752 // process mouse events prior to screenshot session. |
| 741 // See http://crbug.com/459214 | 753 // See http://crbug.com/459214 |
| 742 screenshot_controller_.reset(new ScreenshotController()); | 754 screenshot_controller_.reset(new ScreenshotController()); |
| 743 if (!is_mash) { | 755 if (!is_mash) { |
| 744 mouse_cursor_filter_.reset(new MouseCursorEventFilter()); | 756 mouse_cursor_filter_.reset(new MouseCursorEventFilter()); |
| 745 PrependPreTargetHandler(mouse_cursor_filter_.get()); | 757 PrependPreTargetHandler(mouse_cursor_filter_.get()); |
| 746 } | 758 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { | 929 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { |
| 918 return std::unique_ptr<ui::EventTargetIterator>(); | 930 return std::unique_ptr<ui::EventTargetIterator>(); |
| 919 } | 931 } |
| 920 | 932 |
| 921 ui::EventTargeter* Shell::GetEventTargeter() { | 933 ui::EventTargeter* Shell::GetEventTargeter() { |
| 922 NOTREACHED(); | 934 NOTREACHED(); |
| 923 return nullptr; | 935 return nullptr; |
| 924 } | 936 } |
| 925 | 937 |
| 926 } // namespace ash | 938 } // namespace ash |
| OLD | NEW |