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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 7210020: Added prerendering to omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TODO Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 592c0e3c1004ce28ab3e541f076ece07c9befd02..b742c0c3303bb782ad68af985b584d5e5713e445 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/instant/promo_counter.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/prerender/prerender_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
@@ -169,6 +170,14 @@ void InstantController::Update(TabContentsWrapper* tab_contents,
if (!ShouldShowPreviewFor(match, &template_url)) {
DestroyPreviewContentsAndLeaveActive();
+ // Start Prerender of this page instead.
+ CommandLine* cl = CommandLine::ForCurrentProcess();
sky 2011/06/20 18:15:54 Seems like you only want to do this if you hit the
dominich 2011/06/20 18:40:00 You're right. I didn't think it would matter that
+ if (cl->HasSwitch(switches::kPrerenderFromOmnibox)) {
+ prerender::PrerenderManager* prerender_manager =
+ tab_contents_->profile()->GetPrerenderManager();
+ if (prerender_manager)
+ prerender_manager->AddPrerenderWithNoTag(match.destination_url);
+ }
return;
}

Powered by Google App Engine
This is Rietveld 408576698