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_FILEAPI_ARC_FILE_SYSTEM_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_SERVICE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/observer_list.h" |
9 #include "components/arc/arc_service.h" | 10 #include "components/arc/arc_service.h" |
| 11 #include "components/arc/common/file_system.mojom.h" |
| 12 #include "components/arc/instance_holder.h" |
10 | 13 |
11 namespace arc { | 14 namespace arc { |
12 | 15 |
13 class ArcBridgeService; | 16 class ArcBridgeService; |
| 17 class ArcFileSystemObserver; |
14 | 18 |
15 // ArcFileSystemService registers ARC file systems to the system. | 19 // ArcFileSystemService registers ARC file systems to the system. |
16 class ArcFileSystemService : public ArcService { | 20 class ArcFileSystemService |
| 21 : public ArcService, |
| 22 public InstanceHolder<mojom::FileSystemInstance>::Observer { |
17 public: | 23 public: |
18 explicit ArcFileSystemService(ArcBridgeService* bridge_service); | 24 explicit ArcFileSystemService(ArcBridgeService* bridge_service); |
19 ~ArcFileSystemService() override; | 25 ~ArcFileSystemService() override; |
20 | 26 |
| 27 void AddObserver(ArcFileSystemObserver* observer); |
| 28 void RemoveObserver(ArcFileSystemObserver* observer); |
| 29 |
| 30 // InstanceHolder<mojom::FileSystemInstance>::Observer overrides: |
| 31 void OnInstanceReady() override; |
| 32 void OnInstanceClosed() override; |
| 33 |
| 34 // For supporting ArcServiceManager::GetService<T>(). |
| 35 static const char kArcServiceName[]; |
| 36 |
21 private: | 37 private: |
| 38 base::ObserverList<ArcFileSystemObserver> observer_list_; |
| 39 |
22 DISALLOW_COPY_AND_ASSIGN(ArcFileSystemService); | 40 DISALLOW_COPY_AND_ASSIGN(ArcFileSystemService); |
23 }; | 41 }; |
24 | 42 |
25 } // namespace arc | 43 } // namespace arc |
26 | 44 |
27 #endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_SERVICE_H_ | 45 #endif // CHROME_BROWSER_CHROMEOS_ARC_FILEAPI_ARC_FILE_SYSTEM_SERVICE_H_ |
OLD | NEW |