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

Unified Diff: chrome/renderer/render_view.cc

Issue 3352009: Fix bug where window.open() with no feature string from (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: add license text Created 10 years, 3 months 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/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 0c2eb5a73dfd7289b84bf4a361753179386b4972..30281bd6d2871d330ca69f03ecd45b17007e6d82 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -50,6 +50,7 @@
#include "chrome/renderer/devtools_agent.h"
#include "chrome/renderer/devtools_client.h"
#include "chrome/renderer/extension_groups.h"
+#include "chrome/renderer/extensions/bindings_utils.h"
#include "chrome/renderer/extensions/extension_renderer_info.h"
#include "chrome/renderer/extensions/event_bindings.h"
#include "chrome/renderer/extensions/extension_process_bindings.h"
@@ -2280,6 +2281,13 @@ void RenderView::show(WebNavigationPolicy policy) {
return;
did_show_ = true;
+ // Extensions and apps always allowed to create unrequested popups. The second
+ // check is necessary to include content scripts.
+ if (ExtensionRendererInfo::GetByURL(creator_url_) ||
+ bindings_utils::GetInfoForCurrentContext()) {
+ opened_by_user_gesture_ = true;
+ }
+
// Force new windows to a popup if they were not opened with a user gesture.
if (!opened_by_user_gesture_) {
// We exempt background tabs for compat with older versions of Chrome.

Powered by Google App Engine
This is Rietveld 408576698