| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/omnibox/browser/autocomplete_controller.h" | 5 #include "components/omnibox/browser/autocomplete_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 search_provider_->field_trial_triggered_in_session()) || | 423 search_provider_->field_trial_triggered_in_session()) || |
| 424 (zero_suggest_provider_ && | 424 (zero_suggest_provider_ && |
| 425 zero_suggest_provider_->field_trial_triggered_in_session()), | 425 zero_suggest_provider_->field_trial_triggered_in_session()), |
| 426 input_.current_page_classification()); | 426 input_.current_page_classification()); |
| 427 UpdateMatchDestinationURL(search_terms_args, match); | 427 UpdateMatchDestinationURL(search_terms_args, match); |
| 428 } | 428 } |
| 429 | 429 |
| 430 void AutocompleteController::UpdateMatchDestinationURL( | 430 void AutocompleteController::UpdateMatchDestinationURL( |
| 431 const TemplateURLRef::SearchTermsArgs& search_terms_args, | 431 const TemplateURLRef::SearchTermsArgs& search_terms_args, |
| 432 AutocompleteMatch* match) const { | 432 AutocompleteMatch* match) const { |
| 433 TemplateURL* template_url = match->GetTemplateURL( | 433 const TemplateURL* template_url = match->GetTemplateURL( |
| 434 template_url_service_, false); | 434 template_url_service_, false); |
| 435 if (!template_url) | 435 if (!template_url) |
| 436 return; | 436 return; |
| 437 | 437 |
| 438 match->destination_url = GURL(template_url->url_ref().ReplaceSearchTerms( | 438 match->destination_url = GURL(template_url->url_ref().ReplaceSearchTerms( |
| 439 search_terms_args, template_url_service_->search_terms_data())); | 439 search_terms_args, template_url_service_->search_terms_data())); |
| 440 } | 440 } |
| 441 | 441 |
| 442 void AutocompleteController::UpdateResult( | 442 void AutocompleteController::UpdateResult( |
| 443 bool regenerate_result, | 443 bool regenerate_result, |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 expire_timer_.Stop(); | 699 expire_timer_.Stop(); |
| 700 stop_timer_.Stop(); | 700 stop_timer_.Stop(); |
| 701 done_ = true; | 701 done_ = true; |
| 702 if (clear_result && !result_.empty()) { | 702 if (clear_result && !result_.empty()) { |
| 703 result_.Reset(); | 703 result_.Reset(); |
| 704 // NOTE: We pass in false since we're trying to only clear the popup, not | 704 // NOTE: We pass in false since we're trying to only clear the popup, not |
| 705 // touch the edit... this is all a mess and should be cleaned up :( | 705 // touch the edit... this is all a mess and should be cleaned up :( |
| 706 NotifyChanged(false); | 706 NotifyChanged(false); |
| 707 } | 707 } |
| 708 } | 708 } |
| OLD | NEW |