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..860b89a06295cd9e21d547d54e4142572df5a8b3 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" |
@@ -679,7 +680,7 @@ bool InstantController::ShouldShowPreviewFor(const AutocompleteMatch& match, |
if (match.destination_url.SchemeIs(chrome::kJavaScriptScheme)) |
return false; |
- // Extension keywords don't have a real destionation URL. |
+ // Extension keywords don't have a real destination URL. |
if (match.template_url && match.template_url->IsExtensionKeyword()) |
return false; |
@@ -693,6 +694,14 @@ bool InstantController::ShouldShowPreviewFor(const AutocompleteMatch& match, |
match.type != AutocompleteMatch::SEARCH_HISTORY && |
match.type != AutocompleteMatch::SEARCH_SUGGEST && |
match.type != AutocompleteMatch::SEARCH_OTHER_ENGINE) { |
+ // Start Prerender of this page instead. |
+ CommandLine* cl = CommandLine::ForCurrentProcess(); |
sky
2011/06/20 19:29:24
I don't like that this method has a side effect. C
dominich
2011/06/20 20:48:40
Done.
|
+ if (cl->HasSwitch(switches::kPrerenderFromOmnibox)) { |
+ prerender::PrerenderManager* prerender_manager = |
+ tab_contents_->profile()->GetPrerenderManager(); |
+ if (prerender_manager) |
+ prerender_manager->AddPrerenderWithNoTag(match.destination_url); |
+ } |
return false; |
} |