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

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

Issue 7497058: New windows opened in javascript with target = "_blank" should (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/window.open.blank.html ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "content/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 1319
1320 WebView* RenderView::createView( 1320 WebView* RenderView::createView(
1321 WebFrame* creator, 1321 WebFrame* creator,
1322 const WebURLRequest& request, 1322 const WebURLRequest& request,
1323 const WebWindowFeatures& features, 1323 const WebWindowFeatures& features,
1324 const WebString& frame_name) { 1324 const WebString& frame_name) {
1325 // Check to make sure we aren't overloading on popups. 1325 // Check to make sure we aren't overloading on popups.
1326 if (shared_popup_counter_->data > kMaximumNumberOfUnacknowledgedPopups) 1326 if (shared_popup_counter_->data > kMaximumNumberOfUnacknowledgedPopups)
1327 return NULL; 1327 return NULL;
1328 1328
1329 WebString fixed_frame_name =
darin (slow to review) 2011/08/10 21:44:14 Hmm... perhaps _blank should be stripped on the We
shinyak (Google) 2011/08/11 01:52:33 Hmm... I'm not assure that this is the best positi
shinyak (Google) 2011/08/11 06:43:09 Darin, I've uploaded the patch to WebKit. https://
1330 frame_name == "_blank" ? WebString() : frame_name;
1331
1329 ViewHostMsg_CreateWindow_Params params; 1332 ViewHostMsg_CreateWindow_Params params;
1330 params.opener_id = routing_id_; 1333 params.opener_id = routing_id_;
1331 params.user_gesture = creator->isProcessingUserGesture(); 1334 params.user_gesture = creator->isProcessingUserGesture();
1332 params.window_container_type = WindowFeaturesToContainerType(features); 1335 params.window_container_type = WindowFeaturesToContainerType(features);
1333 params.session_storage_namespace_id = session_storage_namespace_id_; 1336 params.session_storage_namespace_id = session_storage_namespace_id_;
1334 params.frame_name = frame_name; 1337 params.frame_name = fixed_frame_name;
1335 params.opener_frame_id = creator->identifier(); 1338 params.opener_frame_id = creator->identifier();
1336 params.opener_url = creator->document().url(); 1339 params.opener_url = creator->document().url();
1337 params.opener_security_origin = 1340 params.opener_security_origin =
1338 creator->document().securityOrigin().toString().utf8(); 1341 creator->document().securityOrigin().toString().utf8();
1339 if (!request.isNull()) 1342 if (!request.isNull())
1340 params.target_url = request.url(); 1343 params.target_url = request.url();
1341 1344
1342 int32 routing_id = MSG_ROUTING_NONE; 1345 int32 routing_id = MSG_ROUTING_NONE;
1343 int64 cloned_session_storage_namespace_id; 1346 int64 cloned_session_storage_namespace_id;
1344 bool opener_suppressed = creator->willSuppressOpenerInNewFrame(); 1347 bool opener_suppressed = creator->willSuppressOpenerInNewFrame();
1345 1348
1346 render_thread_->Send( 1349 render_thread_->Send(
1347 new ViewHostMsg_CreateWindow(params, 1350 new ViewHostMsg_CreateWindow(params,
1348 &routing_id, 1351 &routing_id,
1349 &cloned_session_storage_namespace_id)); 1352 &cloned_session_storage_namespace_id));
1350 if (routing_id == MSG_ROUTING_NONE) 1353 if (routing_id == MSG_ROUTING_NONE)
1351 return NULL; 1354 return NULL;
1352 1355
1353 RenderView* view = RenderView::Create(render_thread_, 1356 RenderView* view = RenderView::Create(render_thread_,
1354 0, 1357 0,
1355 routing_id_, 1358 routing_id_,
1356 renderer_preferences_, 1359 renderer_preferences_,
1357 webkit_preferences_, 1360 webkit_preferences_,
1358 shared_popup_counter_, 1361 shared_popup_counter_,
1359 routing_id, 1362 routing_id,
1360 cloned_session_storage_namespace_id, 1363 cloned_session_storage_namespace_id,
1361 frame_name); 1364 fixed_frame_name);
1362 view->opened_by_user_gesture_ = params.user_gesture; 1365 view->opened_by_user_gesture_ = params.user_gesture;
1363 1366
1364 // Record whether the creator frame is trying to suppress the opener field. 1367 // Record whether the creator frame is trying to suppress the opener field.
1365 view->opener_suppressed_ = opener_suppressed; 1368 view->opener_suppressed_ = opener_suppressed;
1366 1369
1367 // Record the security origin of the creator. 1370 // Record the security origin of the creator.
1368 GURL creator_url(creator->document().securityOrigin().toString().utf8()); 1371 GURL creator_url(creator->document().securityOrigin().toString().utf8());
1369 if (!creator_url.is_valid() || !creator_url.IsStandard()) 1372 if (!creator_url.is_valid() || !creator_url.IsStandard())
1370 creator_url = GURL(); 1373 creator_url = GURL();
1371 view->creator_url_ = creator_url; 1374 view->creator_url_ = creator_url;
(...skipping 3084 matching lines...) Expand 10 before | Expand all | Expand 10 after
4456 } 4459 }
4457 #endif 4460 #endif
4458 4461
4459 void RenderView::OnContextMenuClosed( 4462 void RenderView::OnContextMenuClosed(
4460 const webkit_glue::CustomContextMenuContext& custom_context) { 4463 const webkit_glue::CustomContextMenuContext& custom_context) {
4461 if (custom_context.is_pepper_menu) 4464 if (custom_context.is_pepper_menu)
4462 pepper_delegate_.OnContextMenuClosed(custom_context); 4465 pepper_delegate_.OnContextMenuClosed(custom_context);
4463 else 4466 else
4464 context_menu_node_.reset(); 4467 context_menu_node_.reset();
4465 } 4468 }
OLDNEW
« no previous file with comments | « chrome/test/data/window.open.blank.html ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698