Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: chrome/renderer/extensions/extension_process_bindings.cc

Issue 434046: Support for chrome.experimental.popup API in ExternalTabContainer views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/extension_process_bindings.cc
===================================================================
--- chrome/renderer/extensions/extension_process_bindings.cc (revision 34039)
+++ chrome/renderer/extensions/extension_process_bindings.cc (working copy)
@@ -147,9 +147,20 @@
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();

Powered by Google App Engine
This is Rietveld 408576698