OLD | NEW |
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 #include "chrome/common/extensions/api/file_system_provider_capabilities/file_sy
stem_provider_capabilities_handler.h" | 5 #include "chrome/common/extensions/api/file_system_provider_capabilities/file_sy
stem_provider_capabilities_handler.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/common/extensions/api/manifest_types.h" | 10 #include "chrome/common/extensions/api/manifest_types.h" |
11 #include "extensions/common/error_utils.h" | 11 #include "extensions/common/error_utils.h" |
12 #include "extensions/common/manifest_constants.h" | 12 #include "extensions/common/manifest_constants.h" |
13 #include "extensions/common/manifest_handlers/permissions_parser.h" | 13 #include "extensions/common/manifest_handlers/permissions_parser.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 FileSystemProviderCapabilities::FileSystemProviderCapabilities() | 18 FileSystemProviderCapabilities::FileSystemProviderCapabilities() |
19 : configurable_(false), multiple_mounts_(false), source_(SOURCE_FILE) { | 19 : configurable_(false), |
| 20 watchable_(false), |
| 21 multiple_mounts_(false), |
| 22 source_(SOURCE_FILE) { |
20 } | 23 } |
21 | 24 |
22 FileSystemProviderCapabilities::FileSystemProviderCapabilities( | 25 FileSystemProviderCapabilities::FileSystemProviderCapabilities( |
23 bool configurable, | 26 bool configurable, |
| 27 bool watchable, |
24 bool multiple_mounts, | 28 bool multiple_mounts, |
25 FileSystemProviderSource source) | 29 FileSystemProviderSource source) |
26 : configurable_(configurable), | 30 : configurable_(configurable), |
| 31 watchable_(watchable), |
27 multiple_mounts_(multiple_mounts), | 32 multiple_mounts_(multiple_mounts), |
28 source_(source) { | 33 source_(source) { |
29 } | 34 } |
30 | 35 |
31 FileSystemProviderCapabilities::~FileSystemProviderCapabilities() { | 36 FileSystemProviderCapabilities::~FileSystemProviderCapabilities() { |
32 } | 37 } |
33 | 38 |
34 FileSystemProviderCapabilitiesHandler::FileSystemProviderCapabilitiesHandler() { | 39 FileSystemProviderCapabilitiesHandler::FileSystemProviderCapabilitiesHandler() { |
35 } | 40 } |
36 | 41 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 break; | 97 break; |
93 case api::manifest_types::FILE_SYSTEM_PROVIDER_SOURCE_NONE: | 98 case api::manifest_types::FILE_SYSTEM_PROVIDER_SOURCE_NONE: |
94 NOTREACHED(); | 99 NOTREACHED(); |
95 } | 100 } |
96 | 101 |
97 scoped_ptr<FileSystemProviderCapabilities> capabilities( | 102 scoped_ptr<FileSystemProviderCapabilities> capabilities( |
98 new FileSystemProviderCapabilities( | 103 new FileSystemProviderCapabilities( |
99 idl_capabilities.configurable.get() | 104 idl_capabilities.configurable.get() |
100 ? *idl_capabilities.configurable.get() | 105 ? *idl_capabilities.configurable.get() |
101 : false /* false by default */, | 106 : false /* false by default */, |
| 107 idl_capabilities.watchable.get() ? *idl_capabilities.watchable.get() |
| 108 : false /* false by default */, |
102 idl_capabilities.multiple_mounts.get() | 109 idl_capabilities.multiple_mounts.get() |
103 ? *idl_capabilities.multiple_mounts.get() | 110 ? *idl_capabilities.multiple_mounts.get() |
104 : false /* false by default */, | 111 : false /* false by default */, |
105 source)); | 112 source)); |
106 | 113 |
107 extension->SetManifestData(manifest_keys::kFileSystemProviderCapabilities, | 114 extension->SetManifestData(manifest_keys::kFileSystemProviderCapabilities, |
108 capabilities.release()); | 115 capabilities.release()); |
109 return true; | 116 return true; |
110 } | 117 } |
111 | 118 |
112 const std::vector<std::string> FileSystemProviderCapabilitiesHandler::Keys() | 119 const std::vector<std::string> FileSystemProviderCapabilitiesHandler::Keys() |
113 const { | 120 const { |
114 return SingleKey(manifest_keys::kFileSystemProviderCapabilities); | 121 return SingleKey(manifest_keys::kFileSystemProviderCapabilities); |
115 } | 122 } |
116 | 123 |
117 bool FileSystemProviderCapabilitiesHandler::AlwaysParseForType( | 124 bool FileSystemProviderCapabilitiesHandler::AlwaysParseForType( |
118 Manifest::Type type) const { | 125 Manifest::Type type) const { |
119 return true; | 126 return true; |
120 } | 127 } |
121 | 128 |
122 } // namespace extensions | 129 } // namespace extensions |
OLD | NEW |