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 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/observer_list.h" | |
12 #include "components/arc/instance_holder.h" | 11 #include "components/arc/instance_holder.h" |
13 | 12 |
14 namespace base { | |
15 class CommandLine; | |
16 } // namespace base | |
17 | |
18 namespace arc { | 13 namespace arc { |
19 | 14 |
20 namespace mojom { | 15 namespace mojom { |
21 | 16 |
22 // Instead of including components/arc/common/arc_bridge.mojom.h, list all the | 17 // Instead of including components/arc/common/arc_bridge.mojom.h, list all the |
23 // instance classes here for faster build. | 18 // instance classes here for faster build. |
24 class AppInstance; | 19 class AppInstance; |
25 class AudioInstance; | 20 class AudioInstance; |
26 class AuthInstance; | 21 class AuthInstance; |
27 class BluetoothInstance; | 22 class BluetoothInstance; |
(...skipping 20 matching lines...) Expand all Loading... |
48 | 43 |
49 } // namespace mojom | 44 } // namespace mojom |
50 | 45 |
51 // Holds Mojo channels which proxy to ARC side implementation. The actual | 46 // Holds Mojo channels which proxy to ARC side implementation. The actual |
52 // instances are set/removed via ArcBridgeHostImpl. | 47 // instances are set/removed via ArcBridgeHostImpl. |
53 class ArcBridgeService { | 48 class ArcBridgeService { |
54 public: | 49 public: |
55 ArcBridgeService(); | 50 ArcBridgeService(); |
56 ~ArcBridgeService(); | 51 ~ArcBridgeService(); |
57 | 52 |
58 // Returns true if ARC has been enabled through a commandline switch. | |
59 static bool GetEnabled(const base::CommandLine* command_line); | |
60 | |
61 // Returns true if ARC is available on the current board. | |
62 static bool GetAvailable(const base::CommandLine* command_line); | |
63 | |
64 InstanceHolder<mojom::AppInstance>* app() { return &app_; } | 53 InstanceHolder<mojom::AppInstance>* app() { return &app_; } |
65 InstanceHolder<mojom::AudioInstance>* audio() { return &audio_; } | 54 InstanceHolder<mojom::AudioInstance>* audio() { return &audio_; } |
66 InstanceHolder<mojom::AuthInstance>* auth() { return &auth_; } | 55 InstanceHolder<mojom::AuthInstance>* auth() { return &auth_; } |
67 InstanceHolder<mojom::BluetoothInstance>* bluetooth() { return &bluetooth_; } | 56 InstanceHolder<mojom::BluetoothInstance>* bluetooth() { return &bluetooth_; } |
68 InstanceHolder<mojom::BootPhaseMonitorInstance>* boot_phase_monitor() { | 57 InstanceHolder<mojom::BootPhaseMonitorInstance>* boot_phase_monitor() { |
69 return &boot_phase_monitor_; | 58 return &boot_phase_monitor_; |
70 } | 59 } |
71 InstanceHolder<mojom::ClipboardInstance>* clipboard() { return &clipboard_; } | 60 InstanceHolder<mojom::ClipboardInstance>* clipboard() { return &clipboard_; } |
72 InstanceHolder<mojom::CrashCollectorInstance>* crash_collector() { | 61 InstanceHolder<mojom::CrashCollectorInstance>* crash_collector() { |
73 return &crash_collector_; | 62 return &crash_collector_; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 InstanceHolder<mojom::TtsInstance> tts_; | 116 InstanceHolder<mojom::TtsInstance> tts_; |
128 InstanceHolder<mojom::VideoInstance> video_; | 117 InstanceHolder<mojom::VideoInstance> video_; |
129 InstanceHolder<mojom::WallpaperInstance> wallpaper_; | 118 InstanceHolder<mojom::WallpaperInstance> wallpaper_; |
130 | 119 |
131 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 120 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
132 }; | 121 }; |
133 | 122 |
134 } // namespace arc | 123 } // namespace arc |
135 | 124 |
136 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 125 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
OLD | NEW |