Chromium Code Reviews| Index: chrome/common/extensions/api/file_system_provider/file_system_provider_handler.h |
| diff --git a/chrome/common/extensions/api/file_system_provider/file_system_provider_handler.h b/chrome/common/extensions/api/file_system_provider/file_system_provider_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..25f2b4c625175a6a56b500c8a595d3ab7f852006 |
| --- /dev/null |
| +++ b/chrome/common/extensions/api/file_system_provider/file_system_provider_handler.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_HANDLER_H_ |
| +#define CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_HANDLER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "chrome/common/extensions/api/file_system_provider.h" |
| +#include "extensions/common/extension.h" |
| +#include "extensions/common/manifest_handler.h" |
| + |
| +namespace extensions { |
| + |
| +// Source of provider file systems. |
| +enum FileSystemProviderSource { SOURCE_FILE, SOURCE_NETWORK, SOURCE_DEVICE }; |
| + |
| +// Represents capabilities of a file system provider. |
| +class FileSystemProviderCapabilities : public Extension::ManifestData { |
|
not at google - send to devlin
2015/04/23 23:16:35
Consider declaring this here:
https://code.google
mtomasz
2015/04/24 12:16:11
I often feel reluctant to use generated types wide
not at google - send to devlin
2015/04/24 16:18:32
I agree. My other issue with using generated types
mtomasz
2015/04/24 17:12:10
I may be missing sth here, but it's exactly what I
|
| + public: |
| + FileSystemProviderCapabilities(); |
| + FileSystemProviderCapabilities(bool configurable, |
| + bool multiple_mounts, |
| + FileSystemProviderSource source); |
| + ~FileSystemProviderCapabilities() override; |
| + |
| + // Returns an array of URL handlers |extension| has defined in its manifest. |
| + static FileSystemProviderCapabilities Get(const Extension* extension); |
| + |
| + bool configurable() const { return configurable_; } |
| + bool multiple_mounts() const { return multiple_mounts_; } |
| + FileSystemProviderSource source() const { return source_; } |
| + |
| + private: |
| + bool configurable_; |
| + bool multiple_mounts_; |
| + FileSystemProviderSource source_; |
| +}; |
| + |
| +// Parses the "file_system_provider" manifest key. |
| +class FileSystemProviderHandler : public ManifestHandler { |
| + public: |
| + FileSystemProviderHandler(); |
| + ~FileSystemProviderHandler() override; |
| + |
| + // ManifestHandler overrides. |
| + bool Parse(Extension* extension, base::string16* error) override; |
| + |
| + private: |
| + const std::vector<std::string> Keys() const override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FileSystemProviderHandler); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_FILE_SYSTEM_PROVIDER_HANDLER_H_ |