Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/files/file.h" | 13 #include "base/files/file.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 19 #include "base/values.h" | 19 #include "base/values.h" |
| 20 #include "chrome/browser/chromeos/file_system_provider/observer.h" | 20 #include "chrome/browser/chromeos/file_system_provider/observer.h" |
| 21 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" | 21 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" |
| 22 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_obse rver.h" | 22 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_obse rver.h" |
| 23 #include "chrome/browser/chromeos/file_system_provider/watcher.h" | 23 #include "chrome/browser/chromeos/file_system_provider/watcher.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/common/extensions/api/file_system_provider.h" | 25 #include "chrome/common/extensions/api/file_system_provider.h" |
| 26 #include "chrome/common/extensions/api/file_system_provider/file_system_provider _handler.h" | |
| 26 #include "components/keyed_service/core/keyed_service.h" | 27 #include "components/keyed_service/core/keyed_service.h" |
| 27 #include "content/public/browser/browser_context.h" | 28 #include "content/public/browser/browser_context.h" |
| 28 #include "extensions/browser/extension_registry_observer.h" | 29 #include "extensions/browser/extension_registry_observer.h" |
| 29 #include "extensions/common/extension.h" | 30 #include "extensions/common/extension.h" |
| 30 #include "storage/browser/fileapi/watcher_manager.h" | 31 #include "storage/browser/fileapi/watcher_manager.h" |
| 31 | 32 |
| 32 namespace extensions { | 33 namespace extensions { |
| 33 class ExtensionRegistry; | 34 class ExtensionRegistry; |
| 34 } // namespace extensions | 35 } // namespace extensions |
| 35 | 36 |
| 36 namespace user_prefs { | 37 namespace user_prefs { |
| 37 class PrefRegistrySyncable; | 38 class PrefRegistrySyncable; |
| 38 } // namespace user_prefs | 39 } // namespace user_prefs |
| 39 | 40 |
| 40 namespace chromeos { | 41 namespace chromeos { |
| 41 namespace file_system_provider { | 42 namespace file_system_provider { |
| 42 | 43 |
| 43 class ProvidedFileSystemFactoryInterface; | 44 class ProvidedFileSystemFactoryInterface; |
| 44 class ProvidedFileSystemInfo; | 45 class ProvidedFileSystemInfo; |
| 45 class ProvidedFileSystemInterface; | 46 class ProvidedFileSystemInterface; |
| 46 class RegistryInterface; | 47 class RegistryInterface; |
| 47 class ServiceFactory; | 48 class ServiceFactory; |
| 48 struct MountOptions; | 49 struct MountOptions; |
| 49 | 50 |
| 50 // Registers preferences to remember registered file systems between reboots. | 51 // Registers preferences to remember registered file systems between reboots. |
| 51 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 52 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 52 | 53 |
| 53 // Holds information for a providing extension. | 54 // Holds information for a providing extension. |
| 54 struct ProvidingExtensionInfo { | 55 struct ProvidingExtensionInfo { |
| 56 typedef extensions::FileSystemProviderCapabilities Capabilities; | |
|
not at google - send to devlin
2015/04/24 17:49:30
prefer not to typedef things in the header file, t
mtomasz
2015/05/07 03:33:59
Done.
| |
| 57 | |
| 55 ProvidingExtensionInfo(); | 58 ProvidingExtensionInfo(); |
| 56 ~ProvidingExtensionInfo(); | 59 ~ProvidingExtensionInfo(); |
| 57 | 60 |
| 58 std::string extension_id; | 61 std::string extension_id; |
| 59 std::string name; | 62 std::string name; |
| 60 bool can_configure; | 63 Capabilities capabilities; |
| 61 bool can_add; | |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 // Manages and registers the file system provider service. Maintains provided | 66 // Manages and registers the file system provider service. Maintains provided |
| 65 // file systems. | 67 // file systems. |
| 66 class Service : public KeyedService, | 68 class Service : public KeyedService, |
| 67 public extensions::ExtensionRegistryObserver, | 69 public extensions::ExtensionRegistryObserver, |
| 68 public ProvidedFileSystemObserver { | 70 public ProvidedFileSystemObserver { |
| 69 public: | 71 public: |
| 70 typedef base::Callback<ProvidedFileSystemInterface*( | 72 typedef base::Callback<ProvidedFileSystemInterface*( |
| 71 Profile* profile, | 73 Profile* profile, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 base::ThreadChecker thread_checker_; | 207 base::ThreadChecker thread_checker_; |
| 206 | 208 |
| 207 base::WeakPtrFactory<Service> weak_ptr_factory_; | 209 base::WeakPtrFactory<Service> weak_ptr_factory_; |
| 208 DISALLOW_COPY_AND_ASSIGN(Service); | 210 DISALLOW_COPY_AND_ASSIGN(Service); |
| 209 }; | 211 }; |
| 210 | 212 |
| 211 } // namespace file_system_provider | 213 } // namespace file_system_provider |
| 212 } // namespace chromeos | 214 } // namespace chromeos |
| 213 | 215 |
| 214 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 216 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| OLD | NEW |