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

Unified Diff: chrome/browser/extensions/api/declarative_content/content_action.cc

Issue 492133002: Renderer changes for wiring up shared memory with declarative injection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed up tests and responded to other comments Created 6 years, 4 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/api/declarative_content/content_action.cc
diff --git a/chrome/browser/extensions/api/declarative_content/content_action.cc b/chrome/browser/extensions/api/declarative_content/content_action.cc
index cce6a867c682a79bcbcc4dd7403dcee545e85b0a..b97a29f61237b89cd6bf84b47a790074587ba718 100644
--- a/chrome/browser/extensions/api/declarative_content/content_action.cc
+++ b/chrome/browser/extensions/api/declarative_content/content_action.cc
@@ -15,11 +15,14 @@
#include "chrome/browser/extensions/extension_action_manager.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sessions/session_tab_helper.h"
#include "content/public/browser/invalidate_type.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
+#include "extensions/common/extension_messages.h"
namespace extensions {
@@ -302,12 +305,12 @@ ContentAction::Type RequestContentScript::GetType() const {
void RequestContentScript::Apply(const std::string& extension_id,
const base::Time& extension_install_time,
ApplyInfo* apply_info) const {
- InstructRenderProcessToInject(apply_info->tab, extension_id);
+ InstructRenderProcessToInject(apply_info->tab, extension_id);
}
void RequestContentScript::Reapply(const std::string& extension_id,
- const base::Time& extension_install_time,
- ApplyInfo* apply_info) const {
+ const base::Time& extension_install_time,
+ ApplyInfo* apply_info) const {
InstructRenderProcessToInject(apply_info->tab, extension_id);
}
@@ -318,7 +321,13 @@ void RequestContentScript::Revert(const std::string& extension_id,
void RequestContentScript::InstructRenderProcessToInject(
content::WebContents* contents,
const std::string& extension_id) const {
- // TODO(markdittmer): Send ExtensionMsg to renderer.
+ content::RenderViewHost* render_view_host = contents->GetRenderViewHost();
+ render_view_host->Send(new ExtensionMsg_ExecuteDeclarativeScript(
+ render_view_host->GetRoutingID(),
+ SessionTabHelper::IdForTab(contents),
+ extension_id,
+ script_.id(),
+ contents->GetLastCommittedURL()));
}
//

Powered by Google App Engine
This is Rietveld 408576698