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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 const AutocompleteMatch& match) { 694 const AutocompleteMatch& match) {
695 const TemplateURL* template_url = match.template_url; 695 const TemplateURL* template_url = match.template_url;
696 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED || 696 if (match.type == AutocompleteMatch::SEARCH_WHAT_YOU_TYPED ||
697 match.type == AutocompleteMatch::SEARCH_HISTORY || 697 match.type == AutocompleteMatch::SEARCH_HISTORY ||
698 match.type == AutocompleteMatch::SEARCH_SUGGEST) { 698 match.type == AutocompleteMatch::SEARCH_SUGGEST) {
699 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel(); 699 TemplateURLModel* model = tab_contents_->profile()->GetTemplateURLModel();
700 template_url = model ? model->GetDefaultSearchProvider() : NULL; 700 template_url = model ? model->GetDefaultSearchProvider() : NULL;
701 } 701 }
702 return template_url; 702 return template_url;
703 } 703 }
704
705 void InstantController::OnAutocompleteGotFocus(
sky 2011/05/20 20:52:18 Position should match that of header.
sreeram 2011/05/21 03:18:27 Done.
706 TabContentsWrapper* tab_contents) {
707 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.
708 if (model) {
709 const TemplateURL* template_url = model->GetDefaultSearchProvider();
710 if (template_url) {
711 if (!loader_manager_.get())
712 loader_manager_.reset(new InstantLoaderManager(this));
713 loader_manager_->GetInstantLoader(template_url->id())
714 ->MaybeLoadInstantURL(tab_contents, template_url);
715 }
716 }
717 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698