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

Unified Diff: chrome/browser/extensions/active_script_controller.cc

Issue 321993003: Refactor renderer-side script injection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 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: chrome/browser/extensions/active_script_controller.cc
diff --git a/chrome/browser/extensions/active_script_controller.cc b/chrome/browser/extensions/active_script_controller.cc
index 62d1ce5a8b416a09fa5cb7dbcca8b9e85db02177..906da8ec1d37f32ccda26e75a42be9f4903a5eb9 100644
--- a/chrome/browser/extensions/active_script_controller.cc
+++ b/chrome/browser/extensions/active_script_controller.cc
@@ -219,7 +219,7 @@ void ActiveScriptController::RunPendingForExtension(
LocationBarController::NotifyChange(web_contents());
}
-void ActiveScriptController::OnRequestContentScriptPermission(
+void ActiveScriptController::OnRequestScriptInjectionPermission(
const std::string& extension_id,
int page_id,
int request_id) {
@@ -251,29 +251,28 @@ void ActiveScriptController::OnRequestContentScriptPermission(
RequestScriptInjection(
extension,
page_id,
- base::Bind(&ActiveScriptController::GrantContentScriptPermission,
+ base::Bind(&ActiveScriptController::PermitScriptInjection,
base::Unretained(this),
request_id));
} else {
- GrantContentScriptPermission(request_id);
+ PermitScriptInjection(request_id);
}
}
-void ActiveScriptController::GrantContentScriptPermission(int request_id) {
+void ActiveScriptController::PermitScriptInjection(int request_id) {
content::RenderViewHost* render_view_host =
web_contents()->GetRenderViewHost();
if (render_view_host) {
- render_view_host->Send(new ExtensionMsg_GrantContentScriptPermission(
- render_view_host->GetRoutingID(),
- request_id));
+ render_view_host->Send(new ExtensionMsg_PermitScriptInjection(
+ render_view_host->GetRoutingID(), request_id));
}
}
bool ActiveScriptController::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ActiveScriptController, message)
- IPC_MESSAGE_HANDLER(ExtensionHostMsg_RequestContentScriptPermission,
- OnRequestContentScriptPermission)
+ IPC_MESSAGE_HANDLER(ExtensionHostMsg_RequestScriptInjectionPermission,
+ OnRequestScriptInjectionPermission)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
« no previous file with comments | « chrome/browser/extensions/active_script_controller.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698