OLD | NEW |
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/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
11 #include "components/arc/arc_bridge_bootstrap.h" | 11 #include "components/arc/arc_bridge_bootstrap.h" |
12 #include "components/arc/arc_bridge_service_impl.h" | 12 #include "components/arc/arc_bridge_service_impl.h" |
13 #include "components/arc/clipboard/arc_clipboard_bridge.h" | 13 #include "components/arc/clipboard/arc_clipboard_bridge.h" |
14 #include "components/arc/ime/arc_ime_bridge.h" | 14 #include "components/arc/ime/arc_ime_bridge.h" |
15 #include "components/arc/input/arc_input_bridge.h" | 15 #include "components/arc/input/arc_input_bridge.h" |
| 16 #include "components/arc/net/arc_net_host_impl.h" |
16 #include "components/arc/power/arc_power_bridge.h" | 17 #include "components/arc/power/arc_power_bridge.h" |
17 #include "ui/arc/notification/arc_notification_manager.h" | 18 #include "ui/arc/notification/arc_notification_manager.h" |
18 | 19 |
19 namespace arc { | 20 namespace arc { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 // Weak pointer. This class is owned by ChromeBrowserMainPartsChromeos. | 24 // Weak pointer. This class is owned by ChromeBrowserMainPartsChromeos. |
24 ArcServiceManager* g_arc_service_manager = nullptr; | 25 ArcServiceManager* g_arc_service_manager = nullptr; |
25 | 26 |
26 } // namespace | 27 } // namespace |
27 | 28 |
28 ArcServiceManager::ArcServiceManager() | 29 ArcServiceManager::ArcServiceManager() |
29 : arc_bridge_service_( | 30 : arc_bridge_service_( |
30 new ArcBridgeServiceImpl(ArcBridgeBootstrap::Create())) { | 31 new ArcBridgeServiceImpl(ArcBridgeBootstrap::Create())) { |
31 DCHECK(!g_arc_service_manager); | 32 DCHECK(!g_arc_service_manager); |
32 g_arc_service_manager = this; | 33 g_arc_service_manager = this; |
33 | 34 |
34 AddService(make_scoped_ptr(new ArcClipboardBridge(arc_bridge_service()))); | 35 AddService(make_scoped_ptr(new ArcClipboardBridge(arc_bridge_service()))); |
35 AddService(make_scoped_ptr(new ArcImeBridge(arc_bridge_service()))); | 36 AddService(make_scoped_ptr(new ArcImeBridge(arc_bridge_service()))); |
36 AddService(make_scoped_ptr(new ArcInputBridge(arc_bridge_service()))); | 37 AddService(make_scoped_ptr(new ArcInputBridge(arc_bridge_service()))); |
| 38 AddService(make_scoped_ptr(new ArcNetHostImpl(arc_bridge_service()))); |
37 AddService(make_scoped_ptr(new ArcPowerBridge(arc_bridge_service()))); | 39 AddService(make_scoped_ptr(new ArcPowerBridge(arc_bridge_service()))); |
38 } | 40 } |
39 | 41 |
40 ArcServiceManager::~ArcServiceManager() { | 42 ArcServiceManager::~ArcServiceManager() { |
41 DCHECK(thread_checker_.CalledOnValidThread()); | 43 DCHECK(thread_checker_.CalledOnValidThread()); |
42 DCHECK(g_arc_service_manager == this); | 44 DCHECK(g_arc_service_manager == this); |
43 g_arc_service_manager = nullptr; | 45 g_arc_service_manager = nullptr; |
44 } | 46 } |
45 | 47 |
46 // static | 48 // static |
(...skipping 16 matching lines...) Expand all Loading... |
63 | 65 |
64 void ArcServiceManager::OnPrimaryUserProfilePrepared( | 66 void ArcServiceManager::OnPrimaryUserProfilePrepared( |
65 const AccountId& account_id) { | 67 const AccountId& account_id) { |
66 DCHECK(thread_checker_.CalledOnValidThread()); | 68 DCHECK(thread_checker_.CalledOnValidThread()); |
67 | 69 |
68 AddService(make_scoped_ptr( | 70 AddService(make_scoped_ptr( |
69 new ArcNotificationManager(arc_bridge_service(), account_id))); | 71 new ArcNotificationManager(arc_bridge_service(), account_id))); |
70 } | 72 } |
71 | 73 |
72 } // namespace arc | 74 } // namespace arc |
OLD | NEW |