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

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: Created 5 years, 9 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
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 dc116905a801f00c131b5da139c888a1b1be8469..fe39638fc124a5a30b015984d00e084edb7b663c 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
@@ -164,6 +164,17 @@ bool Parse(const ContentScriptDetails& script_value,
}
}
+ // code:
+ if (script_value.code) {
+ const std::vector<std::string>& codes = *(script_value.code.get());
+ for (const std::string& code : codes) {
+ extensions::UserScript::File file((base::FilePath()), (base::FilePath()),
+ GURL());
+ file.set_content(code);
Fady Samuel 2015/04/07 20:20:37 You should probably ask devlin@ or kalman@ whether
+ script->js_scripts().push_back(file);
+ }
+ }
+
// all_frames:
if (script_value.all_frames) {
script->set_match_all_frames(*(script_value.all_frames));

Powered by Google App Engine
This is Rietveld 408576698