summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions
diff options
context:
space:
mode:
authortwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 01:59:11 +0000
committertwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 01:59:11 +0000
commita95631cb9427e4d20c243dcd0f36da3fd3e7cb55 (patch)
tree09da2c4493a7303671961051b32718830c451ad7 /chrome/renderer/extensions
parent2007ad49132097b2a2eb10d0025361d1bf7a9340 (diff)
downloadchromium_src-a95631cb9427e4d20c243dcd0f36da3fd3e7cb55.zip
chromium_src-a95631cb9427e4d20c243dcd0f36da3fd3e7cb55.tar.gz
chromium_src-a95631cb9427e4d20c243dcd0f36da3fd3e7cb55.tar.bz2
A collection of fixes allowing the chrome.experimental.popup.* set of APIs to function in circumstances where there is no Browser instance present. This is a symptom of a tab-contents view hosted in an ExternalTabContainer.The major change here is the removal of the explicit dependency on a Browser instance across all of the delegates involved when showing a pop-up API. I modified the following delegates:- ExtensionPopupHost::Delegate- TabContentsDelegate- ExtensionFunctionDispatcher::DelegateBecause the pop-up requires a Profile, and a gfx::NativeWindow, I added methods to the above interfaces to provide them.BUG=noneTEST=ExtensionApiTest.FLAKY_Popup
Review URL: http://codereview.chromium.org/434046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r--chrome/renderer/extensions/extension_process_bindings.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 87efbc4..7af9b5f 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -147,9 +147,20 @@ class ExtensionViewAccumulator : public RenderViewVisitor {
if (extension_id != extension_id_)
return true;
- if (browser_window_id_ != -1 &&
- render_view->browser_window_id() != browser_window_id_)
- return true;
+ // If we are searching for a pop-up, it may be the case that the pop-up
+ // is not attached to a browser window instance. (It is hosted in a
+ // ExternalTabContainer.) If so, then bypass validation of
+ // same-browser-window origin.
+ // TODO(twiz): The browser window id of the views visited should always
+ // match that of the arguments to the accumulator.
+ // See bug: http://crbug.com/29646
+ if (!(view_type_ == ViewType::EXTENSION_POPUP &&
+ render_view->browser_window_id() == -1)) {
+ if (browser_window_id_ != -1 &&
+ render_view->browser_window_id() != browser_window_id_) {
+ return true;
+ }
+ }
v8::Local<v8::Context> context =
render_view->webview()->mainFrame()->mainWorldScriptContext();