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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 #include "components/prefs/pref_service.h" | 132 #include "components/prefs/pref_service.h" |
| 133 #include "components/ui_devtools/devtools_server.h" | 133 #include "components/ui_devtools/devtools_server.h" |
| 134 #include "services/preferences/public/cpp/pref_service_factory.h" | 134 #include "services/preferences/public/cpp/pref_service_factory.h" |
| 135 #include "services/preferences/public/interfaces/preferences.mojom.h" | 135 #include "services/preferences/public/interfaces/preferences.mojom.h" |
| 136 #include "services/service_manager/public/cpp/connector.h" | 136 #include "services/service_manager/public/cpp/connector.h" |
| 137 #include "services/ui/public/interfaces/constants.mojom.h" | 137 #include "services/ui/public/interfaces/constants.mojom.h" |
| 138 #include "ui/app_list/presenter/app_list.h" | 138 #include "ui/app_list/presenter/app_list.h" |
| 139 #include "ui/aura/client/aura_constants.h" | 139 #include "ui/aura/client/aura_constants.h" |
| 140 #include "ui/aura/env.h" | 140 #include "ui/aura/env.h" |
| 141 #include "ui/aura/layout_manager.h" | 141 #include "ui/aura/layout_manager.h" |
| 142 #include "ui/aura/mus/focus_synchronizer.h" | |
| 142 #include "ui/aura/mus/user_activity_forwarder.h" | 143 #include "ui/aura/mus/user_activity_forwarder.h" |
| 144 #include "ui/aura/mus/window_tree_client.h" | |
| 143 #include "ui/aura/window.h" | 145 #include "ui/aura/window.h" |
| 144 #include "ui/aura/window_event_dispatcher.h" | 146 #include "ui/aura/window_event_dispatcher.h" |
| 145 #include "ui/base/ui_base_switches.h" | 147 #include "ui/base/ui_base_switches.h" |
| 146 #include "ui/base/user_activity/user_activity_detector.h" | 148 #include "ui/base/user_activity/user_activity_detector.h" |
| 147 #include "ui/chromeos/user_activity_power_manager_notifier.h" | 149 #include "ui/chromeos/user_activity_power_manager_notifier.h" |
| 148 #include "ui/compositor/layer.h" | 150 #include "ui/compositor/layer.h" |
| 149 #include "ui/compositor/layer_animator.h" | 151 #include "ui/compositor/layer_animator.h" |
| 150 #include "ui/display/display.h" | 152 #include "ui/display/display.h" |
| 151 #include "ui/display/manager/chromeos/display_change_observer.h" | 153 #include "ui/display/manager/chromeos/display_change_observer.h" |
| 152 #include "ui/display/manager/chromeos/display_configurator.h" | 154 #include "ui/display/manager/chromeos/display_configurator.h" |
| 153 #include "ui/display/manager/display_manager.h" | 155 #include "ui/display/manager/display_manager.h" |
| 154 #include "ui/display/screen.h" | 156 #include "ui/display/screen.h" |
| 157 #include "ui/display/types/native_display_delegate.h" | |
|
msw
2017/04/26 23:01:08
nit: remove if not needed
sky
2017/04/26 23:30:28
Done.
| |
| 155 #include "ui/events/event_target_iterator.h" | 158 #include "ui/events/event_target_iterator.h" |
| 156 #include "ui/gfx/geometry/insets.h" | 159 #include "ui/gfx/geometry/insets.h" |
| 157 #include "ui/gfx/image/image_skia.h" | 160 #include "ui/gfx/image/image_skia.h" |
| 158 #include "ui/keyboard/keyboard_controller.h" | 161 #include "ui/keyboard/keyboard_controller.h" |
| 159 #include "ui/keyboard/keyboard_switches.h" | 162 #include "ui/keyboard/keyboard_switches.h" |
| 160 #include "ui/keyboard/keyboard_util.h" | 163 #include "ui/keyboard/keyboard_util.h" |
| 161 #include "ui/views/corewm/tooltip_aura.h" | 164 #include "ui/views/corewm/tooltip_aura.h" |
| 162 #include "ui/views/corewm/tooltip_controller.h" | 165 #include "ui/views/corewm/tooltip_controller.h" |
| 163 #include "ui/views/focus/focus_manager_factory.h" | 166 #include "ui/views/focus/focus_manager_factory.h" |
| 164 #include "ui/views/widget/native_widget_aura.h" | 167 #include "ui/views/widget/native_widget_aura.h" |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 733 shell_delegate_->ShelfShutdown(); | 736 shell_delegate_->ShelfShutdown(); |
| 734 | 737 |
| 735 // Removes itself as an observer of |pref_service_|. | 738 // Removes itself as an observer of |pref_service_|. |
| 736 shelf_controller_.reset(); | 739 shelf_controller_.reset(); |
| 737 | 740 |
| 738 shell_port_->Shutdown(); | 741 shell_port_->Shutdown(); |
| 739 | 742 |
| 740 // Depends on |focus_controller_|, so must be destroyed before. | 743 // Depends on |focus_controller_|, so must be destroyed before. |
| 741 window_tree_host_manager_.reset(); | 744 window_tree_host_manager_.reset(); |
| 742 focus_controller_->RemoveObserver(this); | 745 focus_controller_->RemoveObserver(this); |
| 746 if (GetAshConfig() != Config::CLASSIC && | |
|
msw
2017/04/26 23:01:08
nit: use |config| (line 592)
sky
2017/04/26 23:30:28
Done.
| |
| 747 window_tree_client_->focus_synchronizer()->active_focus_client() == | |
| 748 focus_controller_.get()) { | |
| 749 window_tree_client_->focus_synchronizer()->SetSingletonFocusClient(nullptr); | |
| 750 } | |
| 743 focus_controller_.reset(); | 751 focus_controller_.reset(); |
| 744 screen_position_controller_.reset(); | 752 screen_position_controller_.reset(); |
| 745 | 753 |
| 746 display_color_manager_.reset(); | 754 display_color_manager_.reset(); |
| 747 if (display_change_observer_) | 755 if (display_change_observer_) |
| 748 display_configurator_->RemoveObserver(display_change_observer_.get()); | 756 display_configurator_->RemoveObserver(display_change_observer_.get()); |
| 749 if (display_error_observer_) | 757 if (display_error_observer_) |
| 750 display_configurator_->RemoveObserver(display_error_observer_.get()); | 758 display_configurator_->RemoveObserver(display_error_observer_.get()); |
| 751 if (projecting_observer_) { | 759 if (projecting_observer_) { |
| 752 display_configurator_->RemoveObserver(projecting_observer_.get()); | 760 display_configurator_->RemoveObserver(projecting_observer_.get()); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 900 // windows are active. | 908 // windows are active. |
| 901 window_modality_controller_.reset(new ::wm::WindowModalityController(this)); | 909 window_modality_controller_.reset(new ::wm::WindowModalityController(this)); |
| 902 | 910 |
| 903 env_filter_.reset(new ::wm::CompoundEventFilter); | 911 env_filter_.reset(new ::wm::CompoundEventFilter); |
| 904 AddPreTargetHandler(env_filter_.get()); | 912 AddPreTargetHandler(env_filter_.get()); |
| 905 | 913 |
| 906 // FocusController takes ownership of AshFocusRules. | 914 // FocusController takes ownership of AshFocusRules. |
| 907 focus_controller_ = | 915 focus_controller_ = |
| 908 base::MakeUnique<::wm::FocusController>(new wm::AshFocusRules()); | 916 base::MakeUnique<::wm::FocusController>(new wm::AshFocusRules()); |
| 909 focus_controller_->AddObserver(this); | 917 focus_controller_->AddObserver(this); |
| 918 if (config != Config::CLASSIC) { | |
| 919 window_tree_client_->focus_synchronizer()->SetSingletonFocusClient( | |
| 920 focus_controller_.get()); | |
| 921 } | |
| 910 | 922 |
| 911 screen_position_controller_.reset(new ScreenPositionController); | 923 screen_position_controller_.reset(new ScreenPositionController); |
| 912 | 924 |
| 913 shell_port_->CreatePrimaryHost(); | 925 shell_port_->CreatePrimaryHost(); |
| 914 root_window_for_new_windows_ = WmWindow::Get(GetPrimaryRootWindow()); | 926 root_window_for_new_windows_ = WmWindow::Get(GetPrimaryRootWindow()); |
| 915 | 927 |
| 916 if (config != Config::MASH) { | 928 if (config != Config::MASH) { |
| 917 resolution_notification_controller_.reset( | 929 resolution_notification_controller_.reset( |
| 918 new ResolutionNotificationController); | 930 new ResolutionNotificationController); |
| 919 } | 931 } |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1232 void Shell::OnPrefServiceInitialized( | 1244 void Shell::OnPrefServiceInitialized( |
| 1233 std::unique_ptr<::PrefService> pref_service) { | 1245 std::unique_ptr<::PrefService> pref_service) { |
| 1234 if (!instance_) | 1246 if (!instance_) |
| 1235 return; | 1247 return; |
| 1236 // |pref_service_| is null if can't connect to Chrome (as happens when | 1248 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1237 // running mash outside of chrome --mash and chrome isn't built). | 1249 // running mash outside of chrome --mash and chrome isn't built). |
| 1238 pref_service_ = std::move(pref_service); | 1250 pref_service_ = std::move(pref_service); |
| 1239 } | 1251 } |
| 1240 | 1252 |
| 1241 } // namespace ash | 1253 } // namespace ash |
| OLD | NEW |