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