diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-06 03:23:56 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-06 03:23:56 +0000 |
commit | 2a55391236948b261e9603653ddf8e29e975ebb5 (patch) | |
tree | 0448a8638ca71f12d41048cfcea4a71defa7ba21 /chrome/renderer/chrome_content_renderer_client.cc | |
parent | 2eaa718da12929744e666a217f89da5720b76734 (diff) | |
download | chromium_src-2a55391236948b261e9603653ddf8e29e975ebb5.zip chromium_src-2a55391236948b261e9603653ddf8e29e975ebb5.tar.gz chromium_src-2a55391236948b261e9603653ddf8e29e975ebb5.tar.bz2 |
Refactor the ContextInfo struct from bindings_utils into a
real class. Pull functionality from bindings_utils and
event_bindings in as methods. Simplify lifetime management.
Review URL: http://codereview.chromium.org/7792090
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/chrome_content_renderer_client.cc')
-rw-r--r-- | chrome/renderer/chrome_content_renderer_client.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 7becf4a..5fb7168 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -33,8 +33,7 @@ #include "chrome/renderer/chrome_render_process_observer.h" #include "chrome/renderer/chrome_render_view_observer.h" #include "chrome/renderer/content_settings_observer.h" -#include "chrome/renderer/extensions/bindings_utils.h" -#include "chrome/renderer/extensions/event_bindings.h" +#include "chrome/renderer/extensions/extension_bindings_context.h" #include "chrome/renderer/extensions/extension_dispatcher.h" #include "chrome/renderer/extensions/extension_helper.h" #include "chrome/renderer/extensions/extension_process_bindings.h" @@ -575,7 +574,7 @@ bool ChromeContentRendererClient::AllowPopup(const GURL& creator) { // Extensions and apps always allowed to create unrequested popups. The second // check is necessary to include content scripts. return extension_dispatcher_->extensions()->GetByURL(creator) || - bindings_utils::GetInfoForCurrentContext(); + ExtensionBindingsContext::GetCurrent(); } bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, @@ -643,22 +642,24 @@ void ChromeContentRendererClient::DidCreateScriptContext(WebFrame* frame) { if (frame->mainWorldScriptContext().IsEmpty()) return; - EventBindings::HandleContextCreated(frame, - frame->mainWorldScriptContext(), - extension_dispatcher_.get(), - 0); // isolated world ID + ExtensionBindingsContext::HandleV8ContextCreated( + frame, + frame->mainWorldScriptContext(), + extension_dispatcher_.get(), + 0); // isolated world id } void ChromeContentRendererClient::DidDestroyScriptContext(WebFrame* frame) { - EventBindings::HandleContextDestroyed(frame); + ExtensionBindingsContext::HandleV8ContextDestroyed(frame); } void ChromeContentRendererClient::DidCreateIsolatedScriptContext( WebFrame* frame, int world_id, v8::Handle<v8::Context> context) { - EventBindings::HandleContextCreated(frame, - context, - extension_dispatcher_.get(), - world_id); + ExtensionBindingsContext::HandleV8ContextCreated( + frame, + context, + extension_dispatcher_.get(), + world_id); } unsigned long long ChromeContentRendererClient::VisitedLinkHash( |