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

Side by Side Diff: components/arc/arc_service_manager.cc

Issue 2168533002: Remove window_manager.mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « components/arc/arc_service_manager.h ('k') | components/arc/common/arc_bridge.mojom » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/arc/arc_service_manager.h" 5 #include "components/arc/arc_service_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
11 #include "base/threading/thread_task_runner_handle.h" 11 #include "base/threading/thread_task_runner_handle.h"
12 #include "components/arc/arc_bridge_bootstrap.h" 12 #include "components/arc/arc_bridge_bootstrap.h"
13 #include "components/arc/arc_bridge_service.h" 13 #include "components/arc/arc_bridge_service.h"
14 #include "components/arc/arc_bridge_service_impl.h" 14 #include "components/arc/arc_bridge_service_impl.h"
15 #include "components/arc/audio/arc_audio_bridge.h" 15 #include "components/arc/audio/arc_audio_bridge.h"
16 #include "components/arc/bluetooth/arc_bluetooth_bridge.h" 16 #include "components/arc/bluetooth/arc_bluetooth_bridge.h"
17 #include "components/arc/clipboard/arc_clipboard_bridge.h" 17 #include "components/arc/clipboard/arc_clipboard_bridge.h"
18 #include "components/arc/crash_collector/arc_crash_collector_bridge.h" 18 #include "components/arc/crash_collector/arc_crash_collector_bridge.h"
19 #include "components/arc/ime/arc_ime_service.h" 19 #include "components/arc/ime/arc_ime_service.h"
20 #include "components/arc/intent_helper/activity_icon_loader.h" 20 #include "components/arc/intent_helper/activity_icon_loader.h"
21 #include "components/arc/metrics/arc_metrics_service.h" 21 #include "components/arc/metrics/arc_metrics_service.h"
22 #include "components/arc/net/arc_net_host_impl.h" 22 #include "components/arc/net/arc_net_host_impl.h"
23 #include "components/arc/obb_mounter/arc_obb_mounter_bridge.h" 23 #include "components/arc/obb_mounter/arc_obb_mounter_bridge.h"
24 #include "components/arc/power/arc_power_bridge.h" 24 #include "components/arc/power/arc_power_bridge.h"
25 #include "components/arc/storage_manager/arc_storage_manager.h" 25 #include "components/arc/storage_manager/arc_storage_manager.h"
26 #include "components/arc/user_data/arc_user_data_service.h" 26 #include "components/arc/user_data/arc_user_data_service.h"
27 #include "components/arc/window_manager/arc_window_manager_bridge.h"
28 #include "components/prefs/pref_member.h" 27 #include "components/prefs/pref_member.h"
29 #include "ui/arc/notification/arc_notification_manager.h" 28 #include "ui/arc/notification/arc_notification_manager.h"
30 29
31 namespace arc { 30 namespace arc {
32 31
33 namespace { 32 namespace {
34 33
35 // Weak pointer. This class is owned by ChromeBrowserMainPartsChromeos. 34 // Weak pointer. This class is owned by ChromeBrowserMainPartsChromeos.
36 ArcServiceManager* g_arc_service_manager = nullptr; 35 ArcServiceManager* g_arc_service_manager = nullptr;
37 36
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) { 100 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) {
102 DCHECK(thread_checker_.CalledOnValidThread()); 101 DCHECK(thread_checker_.CalledOnValidThread());
103 102
104 AddService(base::WrapUnique(new ArcUserDataService( 103 AddService(base::WrapUnique(new ArcUserDataService(
105 arc_bridge_service(), std::move(arc_enabled_pref), account_id))); 104 arc_bridge_service(), std::move(arc_enabled_pref), account_id)));
106 105
107 AddService(base::WrapUnique( 106 AddService(base::WrapUnique(
108 new ArcNotificationManager(arc_bridge_service(), account_id))); 107 new ArcNotificationManager(arc_bridge_service(), account_id)));
109 } 108 }
110 109
111 void ArcServiceManager::OnAshStarted() {
112 DCHECK(thread_checker_.CalledOnValidThread());
113 // We might come here multiple times. As such we should only do this once.
114 if (on_ash_started_called_)
115 return;
116
117 on_ash_started_called_ = true;
118 AddService(
119 base::WrapUnique(new ArcWindowManagerBridge(arc_bridge_service())));
120 }
121
122 void ArcServiceManager::Shutdown() { 110 void ArcServiceManager::Shutdown() {
123 icon_loader_ = nullptr; 111 icon_loader_ = nullptr;
124 activity_resolver_ = nullptr; 112 activity_resolver_ = nullptr;
125 services_.clear(); 113 services_.clear();
126 } 114 }
127 115
128 // static 116 // static
129 void ArcServiceManager::SetArcBridgeServiceForTesting( 117 void ArcServiceManager::SetArcBridgeServiceForTesting(
130 std::unique_ptr<ArcBridgeService> arc_bridge_service) { 118 std::unique_ptr<ArcBridgeService> arc_bridge_service) {
131 if (g_arc_bridge_service_for_testing) { 119 if (g_arc_bridge_service_for_testing) {
132 delete g_arc_bridge_service_for_testing; 120 delete g_arc_bridge_service_for_testing;
133 } 121 }
134 g_arc_bridge_service_for_testing = arc_bridge_service.release(); 122 g_arc_bridge_service_for_testing = arc_bridge_service.release();
135 } 123 }
136 124
137 } // namespace arc 125 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_service_manager.h ('k') | components/arc/common/arc_bridge.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698