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

Unified Diff: extensions/common/manifest_handlers/webview_info.cc

Issue 2958343002: [Extensions] Change renderer-side web accessible resource determination (Closed)
Patch Set: s/web_accessible_ids/web_accessible_ids_ Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/manifest_handlers/webview_info.h ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handlers/webview_info.cc
diff --git a/extensions/common/manifest_handlers/webview_info.cc b/extensions/common/manifest_handlers/webview_info.cc
index 57a5aa01f79a8f9de0c13d16c95cc97cb5fef946..cbb913d0a065d6d6c4d535946eb6b1cb65f68ed2 100644
--- a/extensions/common/manifest_handlers/webview_info.cc
+++ b/extensions/common/manifest_handlers/webview_info.cc
@@ -86,6 +86,22 @@ bool WebviewInfo::IsResourceWebviewAccessible(
return false;
}
+// static
+bool WebviewInfo::HasWebviewAccessibleResources(
+ const Extension& extension,
+ const std::string& partition_id) {
+ const WebviewInfo* webview_info = static_cast<const WebviewInfo*>(
+ extension.GetManifestData(keys::kWebviewAccessibleResources));
+ if (!webview_info)
+ return false;
+
+ for (const auto& item : webview_info->partition_items_) {
+ if (item->Matches(partition_id))
+ return true;
+ }
+ return false;
+}
+
void WebviewInfo::AddPartitionItem(std::unique_ptr<PartitionItem> item) {
partition_items_.push_back(std::move(item));
}
« no previous file with comments | « extensions/common/manifest_handlers/webview_info.h ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698