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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1141453003: Fix setting the top-level FrameTreeNode name for named windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Alex's review. Created 5 years, 7 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
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_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) 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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 should_normally_be_visible_ = !params.initially_hidden; 1197 should_normally_be_visible_ = !params.initially_hidden;
1198 1198
1199 // Either both routing ids can be given, or neither can be. 1199 // Either both routing ids can be given, or neither can be.
1200 DCHECK((params.routing_id == MSG_ROUTING_NONE && 1200 DCHECK((params.routing_id == MSG_ROUTING_NONE &&
1201 params.main_frame_routing_id == MSG_ROUTING_NONE) || 1201 params.main_frame_routing_id == MSG_ROUTING_NONE) ||
1202 (params.routing_id != MSG_ROUTING_NONE && 1202 (params.routing_id != MSG_ROUTING_NONE &&
1203 params.main_frame_routing_id != MSG_ROUTING_NONE)); 1203 params.main_frame_routing_id != MSG_ROUTING_NONE));
1204 GetRenderManager()->Init( 1204 GetRenderManager()->Init(
1205 params.browser_context, params.site_instance, params.routing_id, 1205 params.browser_context, params.site_instance, params.routing_id,
1206 params.main_frame_routing_id); 1206 params.main_frame_routing_id);
1207 frame_tree_.root()->SetFrameName(params.main_frame_name);
Charlie Reis 2015/05/12 23:45:24 Could anything in RFHM::Init ever depend on the na
nasko 2015/05/13 00:07:27 SetFrameName actually accesses render_manager_ and
1207 1208
1208 WebContentsViewDelegate* delegate = 1209 WebContentsViewDelegate* delegate =
1209 GetContentClient()->browser()->GetWebContentsViewDelegate(this); 1210 GetContentClient()->browser()->GetWebContentsViewDelegate(this);
1210 1211
1211 if (browser_plugin_guest_) { 1212 if (browser_plugin_guest_) {
1212 scoped_ptr<WebContentsView> platform_view(CreateWebContentsView( 1213 scoped_ptr<WebContentsView> platform_view(CreateWebContentsView(
1213 this, delegate, &render_view_host_delegate_view_)); 1214 this, delegate, &render_view_host_delegate_view_));
1214 1215
1215 WebContentsViewGuest* rv = new WebContentsViewGuest( 1216 WebContentsViewGuest* rv = new WebContentsViewGuest(
1216 this, browser_plugin_guest_.get(), platform_view.Pass(), 1217 this, browser_plugin_guest_.get(), platform_view.Pass(),
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 GetRenderViewHost()->GetProcess()->ResumeRequestsForView( 1576 GetRenderViewHost()->GetProcess()->ResumeRequestsForView(
1576 main_frame_route_id); 1577 main_frame_route_id);
1577 return; 1578 return;
1578 } 1579 }
1579 1580
1580 // Create the new web contents. This will automatically create the new 1581 // Create the new web contents. This will automatically create the new
1581 // WebContentsView. In the future, we may want to create the view separately. 1582 // WebContentsView. In the future, we may want to create the view separately.
1582 CreateParams create_params(GetBrowserContext(), site_instance.get()); 1583 CreateParams create_params(GetBrowserContext(), site_instance.get());
1583 create_params.routing_id = route_id; 1584 create_params.routing_id = route_id;
1584 create_params.main_frame_routing_id = main_frame_route_id; 1585 create_params.main_frame_routing_id = main_frame_route_id;
1586 create_params.main_frame_name = base::UTF16ToUTF8(params.frame_name);
Charlie Reis 2015/05/12 23:45:24 Why do FrameTreeNode and FrameHostMsg_DidChangeNam
nasko 2015/05/13 00:07:27 Yeah, a separate CL will be fine. I tried doing it
1585 create_params.opener = this; 1587 create_params.opener = this;
1586 create_params.opener_suppressed = params.opener_suppressed; 1588 create_params.opener_suppressed = params.opener_suppressed;
1587 if (params.disposition == NEW_BACKGROUND_TAB) 1589 if (params.disposition == NEW_BACKGROUND_TAB)
1588 create_params.initially_hidden = true; 1590 create_params.initially_hidden = true;
1589 create_params.renderer_initiated_creation = true; 1591 create_params.renderer_initiated_creation = true;
1590 1592
1591 WebContentsImpl* new_contents = NULL; 1593 WebContentsImpl* new_contents = NULL;
1592 if (!is_guest) { 1594 if (!is_guest) {
1593 create_params.context = view_->GetNativeView(); 1595 create_params.context = view_->GetNativeView();
1594 create_params.initial_size = GetContainerBounds().size(); 1596 create_params.initial_size = GetContainerBounds().size();
(...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after
4434 node->render_manager()->ResumeResponseDeferredAtStart(); 4436 node->render_manager()->ResumeResponseDeferredAtStart();
4435 } 4437 }
4436 4438
4437 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4439 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4438 force_disable_overscroll_content_ = force_disable; 4440 force_disable_overscroll_content_ = force_disable;
4439 if (view_) 4441 if (view_)
4440 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4442 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4441 } 4443 }
4442 4444
4443 } // namespace content 4445 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698