Chromium Code Reviews| 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..abb95839bb4c51f59b11779b36e43c7e518a13bd 100644 |
| --- a/chrome/browser/extensions/api/declarative_content/content_action.cc |
| +++ b/chrome/browser/extensions/api/declarative_content/content_action.cc |
| @@ -15,11 +15,15 @@ |
| #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 "chrome/common/extensions/manifest_handlers/content_scripts_handler.h" |
|
Devlin
2014/08/26 21:59:15
Do we use this?
Mark Dittmer
2014/08/27 22:37:04
We do not. Removed.
|
| #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 +306,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 +322,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())); |
| } |
| // |