Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chrome/common/extensions/api/file_system_provider/file_system_provider_handler.h

Issue 1077823005: Declare providing extension capabilities in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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();
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698