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

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 6247013: Don't load plugins on prerendered pages until the pages are displayed.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/background_contents_service.h" 8 #include "chrome/browser/background_contents_service.h"
9 #include "chrome/browser/browsing_instance.h" 9 #include "chrome/browser/browsing_instance.h"
10 #include "chrome/browser/prerender/prerender_manager.h" 10 #include "chrome/browser/prerender/prerender_manager.h"
(...skipping 30 matching lines...) Expand all
41 registrar_.Add(this, NotificationType::APP_TERMINATING, 41 registrar_.Add(this, NotificationType::APP_TERMINATING,
42 NotificationService::AllSources()); 42 NotificationService::AllSources());
43 43
44 // Register for our parent profile to shutdown, so we can shut ourselves down 44 // Register for our parent profile to shutdown, so we can shut ourselves down
45 // as well (should only be called for OTR profiles, as we should receive 45 // as well (should only be called for OTR profiles, as we should receive
46 // APP_TERMINATING before non-OTR profiles are destroyed). 46 // APP_TERMINATING before non-OTR profiles are destroyed).
47 // TODO(tburkard): figure out if this is needed. 47 // TODO(tburkard): figure out if this is needed.
48 registrar_.Add(this, NotificationType::PROFILE_DESTROYED, 48 registrar_.Add(this, NotificationType::PROFILE_DESTROYED,
49 Source<Profile>(profile_)); 49 Source<Profile>(profile_));
50 render_view_host_->CreateRenderView(string16()); 50 render_view_host_->CreateRenderView(string16());
51 render_view_host_->NavigateToURL(prerender_url_); 51
52 ViewMsg_Navigate_Params params;
53 params.url = prerender_url_;
54 params.transition = PageTransition::LINK;
55 params.navigation_type = ViewMsg_Navigate_Params::PRERENDER;
56 render_view_host_->Navigate(params);
52 } 57 }
53 58
54 PrerenderContents::~PrerenderContents() { 59 PrerenderContents::~PrerenderContents() {
55 if (!render_view_host_) // Will be null for unit tests. 60 if (!render_view_host_) // Will be null for unit tests.
56 return; 61 return;
57 62
58 render_view_host_->Shutdown(); // deletes render_view_host 63 render_view_host_->Shutdown(); // deletes render_view_host
59 } 64 }
60 65
61 RenderViewHostDelegate::View* PrerenderContents::GetViewDelegate() { 66 RenderViewHostDelegate::View* PrerenderContents::GetViewDelegate() {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 213 }
209 214
210 void PrerenderContents::ShowCreatedWidget(int route_id, 215 void PrerenderContents::ShowCreatedWidget(int route_id,
211 const gfx::Rect& initial_pos) { 216 const gfx::Rect& initial_pos) {
212 NOTIMPLEMENTED(); 217 NOTIMPLEMENTED();
213 } 218 }
214 219
215 void PrerenderContents::ShowCreatedFullscreenWidget(int route_id) { 220 void PrerenderContents::ShowCreatedFullscreenWidget(int route_id) {
216 NOTIMPLEMENTED(); 221 NOTIMPLEMENTED();
217 } 222 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_manager.cc » ('j') | chrome/browser/prerender/prerender_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698