Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_H ANDLER_H_ | |
| 6 #define CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_H ANDLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "chrome/common/extensions/api/file_system_provider.h" | |
| 12 #include "extensions/common/extension.h" | |
| 13 #include "extensions/common/manifest_handler.h" | |
| 14 | |
| 15 namespace extensions { | |
| 16 | |
| 17 // Source of provider file systems. | |
| 18 enum FileSystemProviderSource { SOURCE_FILE, SOURCE_NETWORK, SOURCE_DEVICE }; | |
| 19 | |
| 20 // Represents capabilities of a file system provider. | |
| 21 class FileSystemProviderCapabilities : public Extension::ManifestData { | |
| 22 public: | |
| 23 FileSystemProviderCapabilities(); | |
|
not at google - send to devlin
2015/04/24 16:18:32
do you still need to define the default constructo
mtomasz
2015/04/24 17:12:10
Yes. I store capabilities as a member in Providing
| |
| 24 FileSystemProviderCapabilities(bool configurable, | |
| 25 bool multiple_mounts, | |
| 26 FileSystemProviderSource source); | |
| 27 ~FileSystemProviderCapabilities() override; | |
| 28 | |
| 29 // Returns capabilities of a providing |extension| if declared in the | |
| 30 // manifets. Otherwise NULL. | |
| 31 static const FileSystemProviderCapabilities* Get(const Extension* extension); | |
| 32 | |
| 33 bool configurable() const { return configurable_; } | |
| 34 bool multiple_mounts() const { return multiple_mounts_; } | |
| 35 FileSystemProviderSource source() const { return source_; } | |
| 36 | |
| 37 private: | |
| 38 bool configurable_; | |
| 39 bool multiple_mounts_; | |
| 40 FileSystemProviderSource source_; | |
| 41 }; | |
| 42 | |
| 43 // Parses the "file_system_provider" manifest key. | |
| 44 class FileSystemProviderHandler : public ManifestHandler { | |
| 45 public: | |
| 46 FileSystemProviderHandler(); | |
| 47 ~FileSystemProviderHandler() override; | |
| 48 | |
| 49 // ManifestHandler overrides. | |
| 50 bool Parse(Extension* extension, base::string16* error) override; | |
| 51 | |
| 52 private: | |
| 53 const std::vector<std::string> Keys() const override; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(FileSystemProviderHandler); | |
| 56 }; | |
| 57 | |
| 58 } // namespace extensions | |
| 59 | |
| 60 #endif // CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDE R_HANDLER_H_ | |
| OLD | NEW |