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

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

Issue 9416031: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TODO 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.h" 7 #include "content/browser/renderer_host/render_view_host.h"
8 #include "content/browser/renderer_host/render_widget_host.h" 8 #include "content/browser/renderer_host/render_widget_host.h"
9 #include "content/browser/renderer_host/render_widget_host_view.h" 9 #include "content/browser/renderer_host/render_widget_host_view.h"
10 #include "content/browser/tab_contents/tab_contents.h" 10 #include "content/browser/tab_contents/tab_contents.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Create the new web contents. This will automatically create the new 60 // Create the new web contents. This will automatically create the new
61 // WebContentsView. In the future, we may want to create the view separately. 61 // WebContentsView. In the future, we may want to create the view separately.
62 TabContents* new_contents = 62 TabContents* new_contents =
63 new TabContents(web_contents->GetBrowserContext(), 63 new TabContents(web_contents->GetBrowserContext(),
64 web_contents->GetSiteInstance(), 64 web_contents->GetSiteInstance(),
65 route_id, 65 route_id,
66 static_cast<TabContents*>(web_contents), 66 static_cast<TabContents*>(web_contents),
67 NULL); 67 NULL);
68 new_contents->set_opener_web_ui_type( 68 new_contents->set_opener_web_ui_type(
69 web_contents->GetWebUITypeForCurrentState()); 69 web_contents->GetWebUITypeForCurrentState());
70 new_contents->set_opener_origin(GURL(params.opener_security_origin));
70 content::WebContentsView* new_view = new_contents->GetView(); 71 content::WebContentsView* new_view = new_contents->GetView();
71 72
72 // TODO(brettw): It seems bogus that we have to call this function on the 73 // TODO(brettw): It seems bogus that we have to call this function on the
73 // newly created object and give it one of its own member variables. 74 // newly created object and give it one of its own member variables.
74 new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); 75 new_view->CreateViewForWidget(new_contents->GetRenderViewHost());
75 76
76 // Save the created window associated with the route so we can show it later. 77 // Save the created window associated with the route so we can show it later.
77 pending_contents_[route_id] = new_contents; 78 pending_contents_[route_id] = new_contents;
78 79
79 if (web_contents->GetDelegate()) 80 if (web_contents->GetDelegate())
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 RenderWidgetHostView* widget_host_view = GetCreatedWidget(route_id); 171 RenderWidgetHostView* widget_host_view = GetCreatedWidget(route_id);
171 if (is_fullscreen) { 172 if (is_fullscreen) {
172 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView()); 173 widget_host_view->InitAsFullscreen(web_contents->GetRenderWidgetHostView());
173 } else { 174 } else {
174 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(), 175 widget_host_view->InitAsPopup(web_contents->GetRenderWidgetHostView(),
175 initial_pos); 176 initial_pos);
176 } 177 }
177 widget_host_view->GetRenderWidgetHost()->Init(); 178 widget_host_view->GetRenderWidgetHost()->Init();
178 return widget_host_view; 179 return widget_host_view;
179 } 180 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698