| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_COMMON_MANIFEST_HANDLERS_WEBVIEW_INFO_H_ | 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_WEBVIEW_INFO_H_ |
| 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_WEBVIEW_INFO_H_ | 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_WEBVIEW_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
| 12 #include "extensions/common/manifest_handler.h" | 12 #include "extensions/common/manifest_handler.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class PartitionItem; | 16 class PartitionItem; |
| 17 | 17 |
| 18 // A class to hold the <webview> accessible extension resources | 18 // A class to hold the <webview> accessible extension resources |
| 19 // that may be specified in the manifest of an extension using the | 19 // that may be specified in the manifest of an extension using the |
| 20 // "webview" key. | 20 // "webview" key. |
| 21 class WebviewInfo : public Extension::ManifestData { | 21 class WebviewInfo : public Extension::ManifestData { |
| 22 public: | 22 public: |
| 23 // Get the WebviewInfo from |extension|'s manifest. |
| 24 static const WebviewInfo* Get(const Extension* extension); |
| 25 |
| 23 // Define out of line constructor/destructor to please Clang. | 26 // Define out of line constructor/destructor to please Clang. |
| 24 WebviewInfo(const std::string& extension_id); | 27 WebviewInfo(const std::string& extension_id); |
| 25 ~WebviewInfo() override; | 28 ~WebviewInfo() override; |
| 26 | 29 |
| 27 // Returns true if the specified resource is web accessible and the extension | 30 // Returns true if the specified resource is web accessible and the extension |
| 28 // matches the manifest's extension. | 31 // matches the manifest's extension. |
| 29 bool IsResourceWebviewAccessible(const Extension* extension, | 32 bool IsResourceWebviewAccessible(const Extension* extension, |
| 30 const std::string& partition_id, | 33 const std::string& partition_id, |
| 31 const std::string& relative_path) const; | 34 const std::string& relative_path) const; |
| 32 | 35 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 const std::vector<std::string> Keys() const override; | 52 const std::vector<std::string> Keys() const override; |
| 50 | 53 |
| 51 DISALLOW_COPY_AND_ASSIGN(WebviewHandler); | 54 DISALLOW_COPY_AND_ASSIGN(WebviewHandler); |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 } // namespace extensions | 57 } // namespace extensions |
| 55 | 58 |
| 56 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_WEBVIEW_INFO_H_ | 59 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_WEBVIEW_INFO_H_ |
| OLD | NEW |