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

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

Issue 6990015: Preload Instant search when omnibox is focused. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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 dc8ea6007619b1452364aab58ee3f0e05fff9c71..6f4fd2dc554c4a271ac3a8d21112475d4e91100d 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -701,3 +701,17 @@ const TemplateURL* InstantController::GetTemplateURL(
}
return template_url;
}
+
+void InstantController::OnAutocompleteGotFocus(
sky 2011/05/20 20:52:18 Position should match that of header.
sreeram 2011/05/21 03:18:27 Done.
+ TabContentsWrapper* tab_contents) {
+ TemplateURLModel* model = tab_contents->profile()->GetTemplateURLModel();
sky 2011/05/20 20:52:18 This should do nothing if is_active_ is true. This
sreeram 2011/05/21 03:18:27 Done.
+ if (model) {
+ const TemplateURL* template_url = model->GetDefaultSearchProvider();
+ if (template_url) {
+ if (!loader_manager_.get())
+ loader_manager_.reset(new InstantLoaderManager(this));
+ loader_manager_->GetInstantLoader(template_url->id())
+ ->MaybeLoadInstantURL(tab_contents, template_url);
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698