Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: ash/shell.cc

Issue 2843193002: chromeos: fix focus for mushrome (Closed)
Patch Set: feedback Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shell_port.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 shell_delegate_->ShelfShutdown(); 735 shell_delegate_->ShelfShutdown();
734 736
735 // Removes itself as an observer of |pref_service_|. 737 // Removes itself as an observer of |pref_service_|.
736 shelf_controller_.reset(); 738 shelf_controller_.reset();
737 739
738 shell_port_->Shutdown(); 740 shell_port_->Shutdown();
739 741
740 // Depends on |focus_controller_|, so must be destroyed before. 742 // Depends on |focus_controller_|, so must be destroyed before.
741 window_tree_host_manager_.reset(); 743 window_tree_host_manager_.reset();
742 focus_controller_->RemoveObserver(this); 744 focus_controller_->RemoveObserver(this);
745 if (config != Config::CLASSIC &&
746 window_tree_client_->focus_synchronizer()->active_focus_client() ==
747 focus_controller_.get()) {
748 window_tree_client_->focus_synchronizer()->SetSingletonFocusClient(nullptr);
749 }
743 focus_controller_.reset(); 750 focus_controller_.reset();
744 screen_position_controller_.reset(); 751 screen_position_controller_.reset();
745 752
746 display_color_manager_.reset(); 753 display_color_manager_.reset();
747 if (display_change_observer_) 754 if (display_change_observer_)
748 display_configurator_->RemoveObserver(display_change_observer_.get()); 755 display_configurator_->RemoveObserver(display_change_observer_.get());
749 if (display_error_observer_) 756 if (display_error_observer_)
750 display_configurator_->RemoveObserver(display_error_observer_.get()); 757 display_configurator_->RemoveObserver(display_error_observer_.get());
751 if (projecting_observer_) { 758 if (projecting_observer_) {
752 display_configurator_->RemoveObserver(projecting_observer_.get()); 759 display_configurator_->RemoveObserver(projecting_observer_.get());
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 // windows are active. 907 // windows are active.
901 window_modality_controller_.reset(new ::wm::WindowModalityController(this)); 908 window_modality_controller_.reset(new ::wm::WindowModalityController(this));
902 909
903 env_filter_.reset(new ::wm::CompoundEventFilter); 910 env_filter_.reset(new ::wm::CompoundEventFilter);
904 AddPreTargetHandler(env_filter_.get()); 911 AddPreTargetHandler(env_filter_.get());
905 912
906 // FocusController takes ownership of AshFocusRules. 913 // FocusController takes ownership of AshFocusRules.
907 focus_controller_ = 914 focus_controller_ =
908 base::MakeUnique<::wm::FocusController>(new wm::AshFocusRules()); 915 base::MakeUnique<::wm::FocusController>(new wm::AshFocusRules());
909 focus_controller_->AddObserver(this); 916 focus_controller_->AddObserver(this);
917 if (config != Config::CLASSIC) {
918 window_tree_client_->focus_synchronizer()->SetSingletonFocusClient(
919 focus_controller_.get());
920 }
910 921
911 screen_position_controller_.reset(new ScreenPositionController); 922 screen_position_controller_.reset(new ScreenPositionController);
912 923
913 shell_port_->CreatePrimaryHost(); 924 shell_port_->CreatePrimaryHost();
914 root_window_for_new_windows_ = WmWindow::Get(GetPrimaryRootWindow()); 925 root_window_for_new_windows_ = WmWindow::Get(GetPrimaryRootWindow());
915 926
916 if (config != Config::MASH) { 927 if (config != Config::MASH) {
917 resolution_notification_controller_.reset( 928 resolution_notification_controller_.reset(
918 new ResolutionNotificationController); 929 new ResolutionNotificationController);
919 } 930 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 void Shell::OnPrefServiceInitialized( 1243 void Shell::OnPrefServiceInitialized(
1233 std::unique_ptr<::PrefService> pref_service) { 1244 std::unique_ptr<::PrefService> pref_service) {
1234 if (!instance_) 1245 if (!instance_)
1235 return; 1246 return;
1236 // |pref_service_| is null if can't connect to Chrome (as happens when 1247 // |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). 1248 // running mash outside of chrome --mash and chrome isn't built).
1238 pref_service_ = std::move(pref_service); 1249 pref_service_ = std::move(pref_service);
1239 } 1250 }
1240 1251
1241 } // namespace ash 1252 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/shell_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698