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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 54983012: Add a new version of RenderViewImpl::createView() with a suppress_opener flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 } 2336 }
2337 2337
2338 // WebKit::WebViewClient ------------------------------------------------------ 2338 // WebKit::WebViewClient ------------------------------------------------------
2339 2339
2340 WebView* RenderViewImpl::createView( 2340 WebView* RenderViewImpl::createView(
2341 WebFrame* creator, 2341 WebFrame* creator,
2342 const WebURLRequest& request, 2342 const WebURLRequest& request,
2343 const WebWindowFeatures& features, 2343 const WebWindowFeatures& features,
2344 const WebString& frame_name, 2344 const WebString& frame_name,
2345 WebNavigationPolicy policy) { 2345 WebNavigationPolicy policy) {
2346 return createView(creator, request, features, frame_name, policy,
2347 creator->willSuppressOpenerInNewFrame());
2348 }
2349
2350 WebView* RenderViewImpl::createView(
2351 WebFrame* creator,
2352 const WebURLRequest& request,
2353 const WebWindowFeatures& features,
2354 const WebString& frame_name,
2355 WebNavigationPolicy policy,
2356 bool suppress_opener) {
2346 ViewHostMsg_CreateWindow_Params params; 2357 ViewHostMsg_CreateWindow_Params params;
2347 params.opener_id = routing_id_; 2358 params.opener_id = routing_id_;
2348 params.user_gesture = WebUserGestureIndicator::isProcessingUserGesture(); 2359 params.user_gesture = WebUserGestureIndicator::isProcessingUserGesture();
2349 if (GetContentClient()->renderer()->AllowPopup()) 2360 if (GetContentClient()->renderer()->AllowPopup())
2350 params.user_gesture = true; 2361 params.user_gesture = true;
2351 params.window_container_type = WindowFeaturesToContainerType(features); 2362 params.window_container_type = WindowFeaturesToContainerType(features);
2352 params.session_storage_namespace_id = session_storage_namespace_id_; 2363 params.session_storage_namespace_id = session_storage_namespace_id_;
2353 if (frame_name != "_blank") 2364 if (frame_name != "_blank")
2354 params.frame_name = frame_name; 2365 params.frame_name = frame_name;
2355 params.opener_frame_id = creator->identifier(); 2366 params.opener_frame_id = creator->identifier();
2356 params.opener_url = creator->document().url(); 2367 params.opener_url = creator->document().url();
2357 params.opener_top_level_frame_url = creator->top()->document().url(); 2368 params.opener_top_level_frame_url = creator->top()->document().url();
2358 GURL security_url(creator->document().securityOrigin().toString().utf8()); 2369 GURL security_url(creator->document().securityOrigin().toString().utf8());
2359 if (!security_url.is_valid()) 2370 if (!security_url.is_valid())
2360 security_url = GURL(); 2371 security_url = GURL();
2361 params.opener_security_origin = security_url; 2372 params.opener_security_origin = security_url;
2362 params.opener_suppressed = creator->willSuppressOpenerInNewFrame(); 2373 params.opener_suppressed = suppress_opener;
2363 params.disposition = NavigationPolicyToDisposition(policy); 2374 params.disposition = NavigationPolicyToDisposition(policy);
2364 if (!request.isNull()) { 2375 if (!request.isNull()) {
2365 params.target_url = request.url(); 2376 params.target_url = request.url();
2366 params.referrer = GetReferrerFromRequest(creator, request); 2377 params.referrer = GetReferrerFromRequest(creator, request);
2367 } 2378 }
2368 params.features = features; 2379 params.features = features;
2369 2380
2370 int32 routing_id = MSG_ROUTING_NONE; 2381 int32 routing_id = MSG_ROUTING_NONE;
2371 int32 main_frame_routing_id = MSG_ROUTING_NONE; 2382 int32 main_frame_routing_id = MSG_ROUTING_NONE;
2372 int32 surface_id = 0; 2383 int32 surface_id = 0;
(...skipping 4231 matching lines...) Expand 10 before | Expand all | Expand 10 after
6604 for (size_t i = 0; i < icon_urls.size(); i++) { 6615 for (size_t i = 0; i < icon_urls.size(); i++) {
6605 WebURL url = icon_urls[i].iconURL(); 6616 WebURL url = icon_urls[i].iconURL();
6606 if (!url.isEmpty()) 6617 if (!url.isEmpty())
6607 urls.push_back(FaviconURL(url, 6618 urls.push_back(FaviconURL(url,
6608 ToFaviconType(icon_urls[i].iconType()))); 6619 ToFaviconType(icon_urls[i].iconType())));
6609 } 6620 }
6610 SendUpdateFaviconURL(urls); 6621 SendUpdateFaviconURL(urls);
6611 } 6622 }
6612 6623
6613 } // namespace content 6624 } // namespace content
OLDNEW
« content/renderer/render_view_impl.h ('K') | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698