| 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_SERVICE_MANAGER_H_ | 5 #ifndef COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| 6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "components/signin/core/account_id/account_id.h" | 15 #include "components/signin/core/account_id/account_id.h" |
| 16 | 16 |
| 17 namespace arc { | 17 namespace arc { |
| 18 | 18 |
| 19 class ArcBridgeService; | 19 class ArcBridgeService; |
| 20 class ArcService; | 20 class ArcService; |
| 21 class ArcUserDataService; |
| 21 | 22 |
| 22 // Manages creation and destruction of services that communicate with the ARC | 23 // Manages creation and destruction of services that communicate with the ARC |
| 23 // instance via the ArcBridgeService. | 24 // instance via the ArcBridgeService. |
| 24 class ArcServiceManager { | 25 class ArcServiceManager { |
| 25 public: | 26 public: |
| 26 explicit ArcServiceManager( | 27 explicit ArcServiceManager( |
| 27 scoped_refptr<base::TaskRunner> blocking_task_runner); | 28 scoped_refptr<base::TaskRunner> blocking_task_runner); |
| 28 virtual ~ArcServiceManager(); | 29 virtual ~ArcServiceManager(); |
| 29 | 30 |
| 30 // |arc_bridge_service| can only be accessed on the thread that this | 31 // |arc_bridge_service| can only be accessed on the thread that this |
| (...skipping 24 matching lines...) Expand all Loading... |
| 55 // creation. ArcServiceManager owns |arc_bridge_service|. | 56 // creation. ArcServiceManager owns |arc_bridge_service|. |
| 56 static void SetArcBridgeServiceForTesting( | 57 static void SetArcBridgeServiceForTesting( |
| 57 std::unique_ptr<ArcBridgeService> arc_bridge_service); | 58 std::unique_ptr<ArcBridgeService> arc_bridge_service); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 base::ThreadChecker thread_checker_; | 61 base::ThreadChecker thread_checker_; |
| 61 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 62 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
| 62 | 63 |
| 63 std::unique_ptr<ArcBridgeService> arc_bridge_service_; | 64 std::unique_ptr<ArcBridgeService> arc_bridge_service_; |
| 64 std::vector<std::unique_ptr<ArcService>> services_; | 65 std::vector<std::unique_ptr<ArcService>> services_; |
| 66 std::unique_ptr<ArcUserDataService> arc_user_data_service_; |
| 65 | 67 |
| 66 // True once the window manager service got added, barring adding any more | 68 // True once the window manager service got added, barring adding any more |
| 67 // of those since OnAshStarted() might be called multiple times. | 69 // of those since OnAshStarted() might be called multiple times. |
| 68 bool on_ash_started_called_ = false; | 70 bool on_ash_started_called_ = false; |
| 69 | 71 |
| 70 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); | 72 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 } // namespace arc | 75 } // namespace arc |
| 74 | 76 |
| 75 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 77 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| OLD | NEW |