OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_SERVICE_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SERVICE_LAUNCHER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SERVICE_LAUNCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SERVICE_LAUNCHER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
11 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
12 #include "components/arc/arc_service_manager.h" | 13 #include "components/arc/arc_service_manager.h" |
13 | 14 |
14 namespace arc { | 15 namespace arc { |
15 | 16 |
16 // Detects ARC availability and launches ARC bridge service. | 17 // Detects ARC availability and launches ARC bridge service. |
17 class ArcServiceLauncher { | 18 class ArcServiceLauncher { |
18 public: | 19 public: |
19 ArcServiceLauncher(); | 20 ArcServiceLauncher(); |
20 ~ArcServiceLauncher(); | 21 ~ArcServiceLauncher(); |
21 | 22 |
22 void Initialize(); | 23 void Initialize(); |
23 void Shutdown(); | 24 void Shutdown(); |
24 | 25 |
25 private: | 26 private: |
26 // DBus callback. | 27 // DBus callback. |
27 void OnArcAvailable(bool available); | 28 void OnArcAvailable(bool available); |
28 | 29 |
29 base::ThreadChecker thread_checker_; | 30 base::ThreadChecker thread_checker_; |
30 scoped_ptr<ArcServiceManager> arc_service_manager_; | 31 std::unique_ptr<ArcServiceManager> arc_service_manager_; |
31 base::WeakPtrFactory<ArcServiceLauncher> weak_factory_; | 32 base::WeakPtrFactory<ArcServiceLauncher> weak_factory_; |
32 | 33 |
33 DISALLOW_COPY_AND_ASSIGN(ArcServiceLauncher); | 34 DISALLOW_COPY_AND_ASSIGN(ArcServiceLauncher); |
34 }; | 35 }; |
35 | 36 |
36 } // namespace arc | 37 } // namespace arc |
37 | 38 |
38 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SERVICE_LAUNCHER_H_ | 39 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SERVICE_LAUNCHER_H_ |
OLD | NEW |