| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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 { |
| 55 ProvidingExtensionInfo(); | 56 ProvidingExtensionInfo(); |
| 56 ~ProvidingExtensionInfo(); | 57 ~ProvidingExtensionInfo(); |
| 57 | 58 |
| 58 std::string extension_id; | 59 std::string extension_id; |
| 59 std::string name; | 60 std::string name; |
| 60 bool can_configure; | 61 extensions::FileSystemProviderCapabilities capabilities; |
| 61 bool can_add; | |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // Manages and registers the file system provider service. Maintains provided | 64 // Manages and registers the file system provider service. Maintains provided |
| 65 // file systems. | 65 // file systems. |
| 66 class Service : public KeyedService, | 66 class Service : public KeyedService, |
| 67 public extensions::ExtensionRegistryObserver, | 67 public extensions::ExtensionRegistryObserver, |
| 68 public ProvidedFileSystemObserver { | 68 public ProvidedFileSystemObserver { |
| 69 public: | 69 public: |
| 70 typedef base::Callback<ProvidedFileSystemInterface*( | 70 typedef base::Callback<ProvidedFileSystemInterface*( |
| 71 Profile* profile, | 71 Profile* profile, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 base::ThreadChecker thread_checker_; | 205 base::ThreadChecker thread_checker_; |
| 206 | 206 |
| 207 base::WeakPtrFactory<Service> weak_ptr_factory_; | 207 base::WeakPtrFactory<Service> weak_ptr_factory_; |
| 208 DISALLOW_COPY_AND_ASSIGN(Service); | 208 DISALLOW_COPY_AND_ASSIGN(Service); |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 } // namespace file_system_provider | 211 } // namespace file_system_provider |
| 212 } // namespace chromeos | 212 } // namespace chromeos |
| 213 | 213 |
| 214 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ | 214 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_SERVICE_H_ |
| OLD | NEW |