diff options
author | kalman <kalman@chromium.org> | 2015-02-27 11:49:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-27 19:49:42 +0000 |
commit | 5c00a5de04e21b19cbff2a4920092b45cae67655 (patch) | |
tree | afc3ebd419948c5c7bfdf17309dd34aadf369e2c /extensions/shell/renderer | |
parent | 541ccc34e7fd730e26ad8f213f741fc8f7f472ad (diff) | |
download | chromium_src-5c00a5de04e21b19cbff2a4920092b45cae67655.zip chromium_src-5c00a5de04e21b19cbff2a4920092b45cae67655.tar.gz chromium_src-5c00a5de04e21b19cbff2a4920092b45cae67655.tar.bz2 |
Move ExtensionFrameHelper to the extensions module.
R=rockot@chromium.org,jochen@chromium.org
Review URL: https://codereview.chromium.org/958243002
Cr-Commit-Position: refs/heads/master@{#318496}
Diffstat (limited to 'extensions/shell/renderer')
-rw-r--r-- | extensions/shell/renderer/shell_content_renderer_client.cc | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/extensions/shell/renderer/shell_content_renderer_client.cc b/extensions/shell/renderer/shell_content_renderer_client.cc index e39a515..47e3ad4 100644 --- a/extensions/shell/renderer/shell_content_renderer_client.cc +++ b/extensions/shell/renderer/shell_content_renderer_client.cc @@ -12,6 +12,7 @@ #include "extensions/common/extensions_client.h" #include "extensions/renderer/default_dispatcher_delegate.h" #include "extensions/renderer/dispatcher.h" +#include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/extension_helper.h" #include "extensions/renderer/guest_view/extensions_guest_view_container.h" #include "extensions/renderer/guest_view/guest_view_container.h" @@ -33,44 +34,6 @@ using content::RenderThread; namespace extensions { -namespace { - -// TODO: promote ExtensionFrameHelper to a common place and share with this. -class ShellFrameHelper - : public content::RenderFrameObserver, - public content::RenderFrameObserverTracker<ShellFrameHelper> { - public: - ShellFrameHelper(content::RenderFrame* render_frame, - Dispatcher* extension_dispatcher); - ~ShellFrameHelper() override; - - // RenderFrameObserver implementation. - void WillReleaseScriptContext(v8::Handle<v8::Context>, int world_id) override; - - private: - Dispatcher* extension_dispatcher_; - - DISALLOW_COPY_AND_ASSIGN(ShellFrameHelper); -}; - -ShellFrameHelper::ShellFrameHelper(content::RenderFrame* render_frame, - Dispatcher* extension_dispatcher) - : content::RenderFrameObserver(render_frame), - content::RenderFrameObserverTracker<ShellFrameHelper>(render_frame), - extension_dispatcher_(extension_dispatcher) { -} - -ShellFrameHelper::~ShellFrameHelper() { -} - -void ShellFrameHelper::WillReleaseScriptContext(v8::Handle<v8::Context> context, - int world_id) { - extension_dispatcher_->WillReleaseScriptContext( - render_frame()->GetWebFrame(), context, world_id); -} - -} // namespace - ShellContentRendererClient::ShellContentRendererClient() { } @@ -99,8 +62,8 @@ void ShellContentRendererClient::RenderThreadStarted() { void ShellContentRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { - // ShellFrameHelper destroys itself when the RenderFrame is destroyed. - new ShellFrameHelper(render_frame, extension_dispatcher_.get()); + // ExtensionFrameHelper destroys itself when the RenderFrame is destroyed. + new ExtensionFrameHelper(render_frame, extension_dispatcher_.get()); // TODO(jamescook): Do we need to add a new PepperHelper(render_frame) here? // It doesn't seem necessary for either Pepper or NaCl. |