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

Side by Side Diff: chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h

Issue 1221093002: Add support for refreshing contents of providers which don't support watchers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests. Created 5 years, 5 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_CAPABILITIES_FILE_SYST EM_PROVIDER_CAPABILITIES_HANDLER_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_CAPABILITIES_FILE_SYST EM_PROVIDER_CAPABILITIES_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_CAPABILITIES_FILE_SYST EM_PROVIDER_CAPABILITIES_HANDLER_H_ 6 #define CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_CAPABILITIES_FILE_SYST EM_PROVIDER_CAPABILITIES_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "chrome/common/extensions/api/file_system_provider.h" 11 #include "chrome/common/extensions/api/file_system_provider.h"
12 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
13 #include "extensions/common/manifest_handler.h" 13 #include "extensions/common/manifest_handler.h"
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 // Source of provider file systems. 17 // Source of provider file systems.
18 enum FileSystemProviderSource { SOURCE_FILE, SOURCE_NETWORK, SOURCE_DEVICE }; 18 enum FileSystemProviderSource { SOURCE_FILE, SOURCE_NETWORK, SOURCE_DEVICE };
19 19
20 // Represents capabilities of a file system provider. 20 // Represents capabilities of a file system provider.
21 class FileSystemProviderCapabilities : public Extension::ManifestData { 21 class FileSystemProviderCapabilities : public Extension::ManifestData {
22 public: 22 public:
23 FileSystemProviderCapabilities(); 23 FileSystemProviderCapabilities();
24 FileSystemProviderCapabilities(bool configurable, 24 FileSystemProviderCapabilities(bool configurable,
25 bool watchable,
25 bool multiple_mounts, 26 bool multiple_mounts,
26 FileSystemProviderSource source); 27 FileSystemProviderSource source);
27 ~FileSystemProviderCapabilities() override; 28 ~FileSystemProviderCapabilities() override;
28 29
29 // Returns capabilities of a providing |extension| if declared in the 30 // Returns capabilities of a providing |extension| if declared in the
30 // manifets. Otherwise NULL. 31 // manifets. Otherwise NULL.
31 static const FileSystemProviderCapabilities* Get(const Extension* extension); 32 static const FileSystemProviderCapabilities* Get(const Extension* extension);
32 33
33 bool configurable() const { return configurable_; } 34 bool configurable() const { return configurable_; }
35 bool watchable() const { return watchable_; }
34 bool multiple_mounts() const { return multiple_mounts_; } 36 bool multiple_mounts() const { return multiple_mounts_; }
35 FileSystemProviderSource source() const { return source_; } 37 FileSystemProviderSource source() const { return source_; }
36 38
37 private: 39 private:
38 bool configurable_; 40 bool configurable_;
41 bool watchable_;
39 bool multiple_mounts_; 42 bool multiple_mounts_;
40 FileSystemProviderSource source_; 43 FileSystemProviderSource source_;
41 }; 44 };
42 45
43 // Parses the "file_system_provider_capabilities" manifest key. 46 // Parses the "file_system_provider_capabilities" manifest key.
44 class FileSystemProviderCapabilitiesHandler : public ManifestHandler { 47 class FileSystemProviderCapabilitiesHandler : public ManifestHandler {
45 public: 48 public:
46 FileSystemProviderCapabilitiesHandler(); 49 FileSystemProviderCapabilitiesHandler();
47 ~FileSystemProviderCapabilitiesHandler() override; 50 ~FileSystemProviderCapabilitiesHandler() override;
48 51
49 // ManifestHandler overrides. 52 // ManifestHandler overrides.
50 bool Parse(Extension* extension, base::string16* error) override; 53 bool Parse(Extension* extension, base::string16* error) override;
51 bool AlwaysParseForType(Manifest::Type type) const override; 54 bool AlwaysParseForType(Manifest::Type type) const override;
52 55
53 private: 56 private:
54 const std::vector<std::string> Keys() const override; 57 const std::vector<std::string> Keys() const override;
55 58
56 DISALLOW_COPY_AND_ASSIGN(FileSystemProviderCapabilitiesHandler); 59 DISALLOW_COPY_AND_ASSIGN(FileSystemProviderCapabilitiesHandler);
57 }; 60 };
58 61
59 } // namespace extensions 62 } // namespace extensions
60 63
61 #endif // CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_CAPABILITIES_FILE_S YSTEM_PROVIDER_CAPABILITIES_HANDLER_H_ 64 #endif // CHROME_COMMON_EXTENSIONS_API_FILE_SYSTEM_PROVIDER_CAPABILITIES_FILE_S YSTEM_PROVIDER_CAPABILITIES_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698