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

Unified Diff: content/renderer/render_view_impl.cc

Issue 98523003: Implement "presentation" feature for window.open() Base URL: https://github.com/drott/cameo.git@presentationWindowSquashed
Patch Set: Created 7 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
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | ui/base/window_open_disposition_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 82567ede99a6d08a95f396901c3dbb99530086ee..ecbef86666e867e9c7c5a819ef3b384287527cc4 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -555,6 +555,8 @@ static WindowOpenDisposition NavigationPolicyToDisposition(
return NEW_WINDOW;
case blink::WebNavigationPolicyNewPopup:
return NEW_POPUP;
+ case blink::WebNavigationPolicyPresentationWindow:
+ return PRESENTATION_WINDOW;
default:
NOTREACHED() << "Unexpected WebNavigationPolicy";
return IGNORE_ACTION;
@@ -2236,6 +2238,7 @@ WebView* RenderViewImpl::createView(
params.opener_security_origin = security_url;
params.opener_suppressed = suppress_opener;
params.disposition = NavigationPolicyToDisposition(policy);
+
if (!request.isNull()) {
params.target_url = request.url();
params.referrer = GetReferrerFromRequest(creator, request);
@@ -2882,16 +2885,19 @@ void RenderViewImpl::show(WebNavigationPolicy policy) {
// We exempt background tabs for compat with older versions of Chrome.
// TODO(darin): This seems bogus. These should have a user gesture, so
// we probably don't need this check.
- if (policy != blink::WebNavigationPolicyNewBackgroundTab)
+ if (policy != blink::WebNavigationPolicyNewBackgroundTab ||
+ policy != blink::WebNavigationPolicyPresentationWindow)
policy = blink::WebNavigationPolicyNewPopup;
}
// NOTE: initial_pos_ may still have its default values at this point, but
// that's okay. It'll be ignored if disposition is not NEW_POPUP, or the
// browser process will impose a default position otherwise.
+
Send(new ViewHostMsg_ShowView(opener_id_, routing_id_,
NavigationPolicyToDisposition(policy), initial_pos_,
opened_by_user_gesture_));
+
SetPendingWindowRect(initial_pos_);
}
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | ui/base/window_open_disposition_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698