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

Side by Side Diff: ash/shell.cc

Issue 2863623005: ash: Instantiate UserActivityForwarder for --mus. (Closed)
Patch Set: check for aura::Env::Mode::MUS 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 | « no previous file | no next file » | 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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 screen_pinning_controller_ = base::MakeUnique<ScreenPinningController>(); 976 screen_pinning_controller_ = base::MakeUnique<ScreenPinningController>();
977 977
978 lock_state_controller_ = 978 lock_state_controller_ =
979 base::MakeUnique<LockStateController>(shutdown_controller_.get()); 979 base::MakeUnique<LockStateController>(shutdown_controller_.get());
980 power_button_controller_.reset( 980 power_button_controller_.reset(
981 new PowerButtonController(lock_state_controller_.get())); 981 new PowerButtonController(lock_state_controller_.get()));
982 // Pass the initial display state to PowerButtonController. 982 // Pass the initial display state to PowerButtonController.
983 power_button_controller_->OnDisplayModeChanged( 983 power_button_controller_->OnDisplayModeChanged(
984 display_configurator_->cached_displays()); 984 display_configurator_->cached_displays());
985 985
986 // Forward user activity from the window server to |user_activity_detector_|.
986 // The connector is unavailable in some tests. 987 // The connector is unavailable in some tests.
987 if (config == Config::MASH && shell_delegate_->GetShellConnector()) { 988 if (aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS &&
989 shell_delegate_->GetShellConnector()) {
988 ui::mojom::UserActivityMonitorPtr user_activity_monitor; 990 ui::mojom::UserActivityMonitorPtr user_activity_monitor;
989 shell_delegate_->GetShellConnector()->BindInterface(ui::mojom::kServiceName, 991 shell_delegate_->GetShellConnector()->BindInterface(ui::mojom::kServiceName,
990 &user_activity_monitor); 992 &user_activity_monitor);
991 user_activity_forwarder_ = base::MakeUnique<aura::UserActivityForwarder>( 993 user_activity_forwarder_ = base::MakeUnique<aura::UserActivityForwarder>(
992 std::move(user_activity_monitor), user_activity_detector_.get()); 994 std::move(user_activity_monitor), user_activity_detector_.get());
993 } 995 }
994 996
995 drag_drop_controller_.reset(new DragDropController); 997 drag_drop_controller_.reset(new DragDropController);
996 // |screenshot_controller_| needs to be created (and prepended as a 998 // |screenshot_controller_| needs to be created (and prepended as a
997 // pre-target handler) at this point, because |mouse_cursor_filter_| needs to 999 // pre-target handler) at this point, because |mouse_cursor_filter_| needs to
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 void Shell::OnPrefServiceInitialized( 1244 void Shell::OnPrefServiceInitialized(
1243 std::unique_ptr<::PrefService> pref_service) { 1245 std::unique_ptr<::PrefService> pref_service) {
1244 if (!instance_) 1246 if (!instance_)
1245 return; 1247 return;
1246 // |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
1247 // running mash outside of chrome --mash and chrome isn't built). 1249 // running mash outside of chrome --mash and chrome isn't built).
1248 pref_service_ = std::move(pref_service); 1250 pref_service_ = std::move(pref_service);
1249 } 1251 }
1250 1252
1251 } // namespace ash 1253 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698