Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } | |
| OLD | NEW |