summaryrefslogtreecommitdiffstats
path: root/extensions/browser/api/guest_view
diff options
context:
space:
mode:
authorhanxi <hanxi@chromium.org>2015-04-27 07:09:55 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-27 14:09:59 +0000
commit0f31f97fc9577a559a527a3421981b75427791b8 (patch)
tree59eaad2de65376b07b01900df5d6abfed55ce279 /extensions/browser/api/guest_view
parent19ec19105cc04f12bfaf62c1f6a62058a8b010ec (diff)
downloadchromium_src-0f31f97fc9577a559a527a3421981b75427791b8.zip
chromium_src-0f31f97fc9577a559a527a3421981b75427791b8.tar.gz
chromium_src-0f31f97fc9577a559a527a3421981b75427791b8.tar.bz2
Implement <webview>.addContentScript/removeContentScript API [3]
This patch enables the code injection for <webview>.addContentScript/removeContentScript API. This is the third patch in a series of patches: 1) Implement <webview>.addContentScript/removeContentScript API [1] (https://codereview.chromium.org/959413003) 2) Implement <webview>.addContentScript/removeContentScript API [2] (https://codereview.chromium.org/1056533002) 3) Implement <webview>.addContentScript/removeContentScript API [3] (https://codereview.chromium.org/1058113002) BUG=461052 Review URL: https://codereview.chromium.org/1058113002 Cr-Commit-Position: refs/heads/master@{#327037}
Diffstat (limited to 'extensions/browser/api/guest_view')
-rw-r--r--extensions/browser/api/guest_view/web_view/web_view_internal_api.cc8
1 files changed, 8 insertions, 0 deletions
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 af44753..0627e78 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));