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; |
} |