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

Unified Diff: extensions/browser/api/guest_view/web_view/web_view_internal_api.cc

Issue 1058113002: Implement <webview>.addContentScript/removeContentScript API [3] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webui_api_1
Patch Set: nits. Created 5 years, 8 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 | « chrome/test/data/webui/webview_execute_script_test.js ('k') | extensions/common/api/web_view_internal.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
diff --git a/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc b/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
index af447536a68fa287873d2113f3c59dd72d09d1ac..0627e78fe8f6e5948c4967e7728d34eccef2f3d5 100644
--- a/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
+++ b/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
@@ -174,6 +174,14 @@ bool ParseContentScript(const ContentScriptDetails& script_value,
}
}
+ // code:
+ if (script_value.code) {
+ extensions::UserScript::File file((base::FilePath()), (base::FilePath()),
+ GURL());
+ file.set_content(*(script_value.code.get()));
+ script->js_scripts().push_back(file);
+ }
+
// all_frames:
if (script_value.all_frames)
script->set_match_all_frames(*(script_value.all_frames));
« no previous file with comments | « chrome/test/data/webui/webview_execute_script_test.js ('k') | extensions/common/api/web_view_internal.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698