diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-19 18:25:04 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-19 18:25:04 +0000 |
commit | b8f41a197500eb0d6fbff3e8f1216d99a49b7d07 (patch) | |
tree | dcf08cdca241fce9c8c0775a4ce9b6805363d432 /chrome/renderer/extensions | |
parent | 498dd0c587f7307f7969d487dc25125fda3ca872 (diff) | |
download | chromium_src-b8f41a197500eb0d6fbff3e8f1216d99a49b7d07.zip chromium_src-b8f41a197500eb0d6fbff3e8f1216d99a49b7d07.tar.gz chromium_src-b8f41a197500eb0d6fbff3e8f1216d99a49b7d07.tar.bz2 |
Give chrome-extension frames in regular renderers access to messaging APIs,
but nothing else. This is the chrome-side of webkit bug
https://bugs.webkit.org/show_bug.cgi?id=37681
BUG=37920
Review URL: http://codereview.chromium.org/1663003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r-- | chrome/renderer/extensions/extension_api_client_unittest.cc | 1 | ||||
-rw-r--r-- | chrome/renderer/extensions/extension_process_bindings.cc | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/chrome/renderer/extensions/extension_api_client_unittest.cc b/chrome/renderer/extensions/extension_api_client_unittest.cc index 10b6993..86526cf 100644 --- a/chrome/renderer/extensions/extension_api_client_unittest.cc +++ b/chrome/renderer/extensions/extension_api_client_unittest.cc @@ -32,6 +32,7 @@ class ExtensionAPIClientTest : public RenderViewTest { virtual void SetUp() { RenderViewTest::SetUp(); + render_thread_.SetExtensionProcess(true); render_thread_.sink().ClearMessages(); LoadHTML("<body></body>"); } diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc index fe8abcd..a12ef09 100644 --- a/chrome/renderer/extensions/extension_process_bindings.cc +++ b/chrome/renderer/extensions/extension_process_bindings.cc @@ -23,6 +23,7 @@ #include "chrome/renderer/extensions/js_only_v8_extensions.h" #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/renderer/user_script_slave.h" +#include "chrome/renderer/render_thread.h" #include "chrome/renderer/render_view.h" #include "grit/common_resources.h" #include "grit/renderer_resources.h" @@ -246,6 +247,8 @@ class ExtensionImpl : public ExtensionBase { return v8::FunctionTemplate::New(GetPopupParentWindow); } else if (name->Equals(v8::String::New("SetExtensionActionIcon"))) { return v8::FunctionTemplate::New(SetExtensionActionIcon); + } else if (name->Equals(v8::String::New("IsExtensionProcess"))) { + return v8::FunctionTemplate::New(IsExtensionProcess); } return ExtensionBase::GetNativeFunction(name); @@ -520,6 +523,13 @@ class ExtensionImpl : public ExtensionBase { return v8::Undefined(); return v8::Integer::New(renderview->routing_id()); } + + static v8::Handle<v8::Value> IsExtensionProcess(const v8::Arguments& args) { + bool retval = false; + if (EventBindings::GetRenderThread()) + retval = EventBindings::GetRenderThread()->IsExtensionProcess(); + return v8::Boolean::New(retval); + } }; } // namespace |