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

Side by Side Diff: content/browser/tab_contents/tab_contents_view_helper.cc

Issue 9623018: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
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/tab_contents/tab_contents_view_helper.h" 5 #include "content/browser/tab_contents/tab_contents_view_helper.h"
6 6
7 #include "content/browser/renderer_host/render_view_host_impl.h" 7 #include "content/browser/renderer_host/render_view_host_impl.h"
8 #include "content/browser/tab_contents/tab_contents.h" 8 #include "content/browser/tab_contents/tab_contents.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "content/port/browser/render_widget_host_view_port.h" 10 #include "content/port/browser/render_widget_host_view_port.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // Create the new web contents. This will automatically create the new 74 // Create the new web contents. This will automatically create the new
75 // WebContentsView. In the future, we may want to create the view separately. 75 // WebContentsView. In the future, we may want to create the view separately.
76 TabContents* new_contents = 76 TabContents* new_contents =
77 new TabContents(web_contents->GetBrowserContext(), 77 new TabContents(web_contents->GetBrowserContext(),
78 site_instance, 78 site_instance,
79 route_id, 79 route_id,
80 static_cast<TabContents*>(web_contents), 80 static_cast<TabContents*>(web_contents),
81 NULL); 81 NULL);
82 new_contents->set_opener_web_ui_type( 82 new_contents->set_opener_web_ui_type(
83 web_contents->GetWebUITypeForCurrentState()); 83 web_contents->GetWebUITypeForCurrentState());
84 new_contents->set_has_opener(!params.opener_url.is_empty());
84 85
85 if (params.opener_suppressed) { 86 if (params.opener_suppressed) {
86 // When the opener is suppressed, the original renderer cannot access the 87 // When the opener is suppressed, the original renderer cannot access the
87 // new window. As a result, we need to show and navigate the window here. 88 // new window. As a result, we need to show and navigate the window here.
88 gfx::Rect initial_pos; 89 gfx::Rect initial_pos;
89 web_contents->AddNewContents(new_contents, 90 web_contents->AddNewContents(new_contents,
90 params.disposition, 91 params.disposition,
91 initial_pos, 92 initial_pos,
92 params.user_gesture); 93 params.user_gesture);
93 content::OpenURLParams open_params(params.target_url, content::Referrer(), 94 content::OpenURLParams open_params(params.target_url, content::Referrer(),
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id)); 206 RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id));
206 if (is_fullscreen) { 207 if (is_fullscreen) {
207 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); 208 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView());
208 } else { 209 } else {
209 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), 210 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(),
210 initial_pos); 211 initial_pos);
211 } 212 }
212 RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost())->Init(); 213 RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost())->Init();
213 return widget_host_view; 214 return widget_host_view;
214 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698