Index: chrome/browser/autocomplete/autocomplete_edit.cc |
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc |
index eb6c6a72b782779372fb4ea3fb45d43dfe1b4950..7f37bcd34e70e2b7f737947df70115b36f37185f 100644 |
--- a/chrome/browser/autocomplete/autocomplete_edit.cc |
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc |
@@ -7,6 +7,7 @@ |
#include <string> |
#include "base/basictypes.h" |
+#include "base/command_line.h" |
#include "base/metrics/histogram.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
@@ -23,6 +24,7 @@ |
#include "chrome/browser/instant/instant_controller.h" |
#include "chrome/browser/net/predictor_api.h" |
#include "chrome/browser/net/url_fixer_upper.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" |
@@ -30,6 +32,7 @@ |
#include "chrome/browser/ui/browser_list.h" |
#include "chrome/browser/ui/omnibox/omnibox_view.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
+#include "chrome/common/chrome_switches.h" |
#include "chrome/common/url_constants.h" |
#include "content/browser/user_metrics.h" |
#include "content/common/notification_service.h" |
@@ -222,13 +225,26 @@ void AutocompleteEditModel::OnChanged() { |
// case we don't want to load a preview. |
instant->DestroyPreviewContentsAndLeaveActive(); |
} else { |
- instant->Update(tab, CurrentMatch(), view_->GetText(), |
+ instant->Update(tab, current_match, view_->GetText(), |
UseVerbatimInstant(), &suggested_text); |
} |
} else { |
instant->DestroyPreviewContents(); |
} |
might_support_instant = instant->MightSupportInstant(); |
+ } else if (tab && tab->tab_contents()) { |
sky
2011/06/20 19:29:24
Combine your ifs. Also, I believe you only want to
dominich
2011/06/20 20:48:40
Done.
|
+ if (user_input_in_progress() && popup_->IsOpen()) { |
+ // Start Prerender of this page instead. |
+ CommandLine* cl = CommandLine::ForCurrentProcess(); |
+ if (cl->HasSwitch(switches::kPrerenderFromOmnibox)) { |
+ prerender::PrerenderManager* prerender_manager = |
+ tab->tab_contents()->profile()->GetPrerenderManager(); |
+ if (prerender_manager) { |
+ prerender_manager->AddPrerenderWithNoTag( |
+ CurrentMatch().destination_url); |
+ } |
+ } |
+ } |
} |
if (!might_support_instant) { |