| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/autocomplete/autocomplete.h" | 5 #include "chrome/browser/autocomplete/autocomplete.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 for (ACProviders::const_iterator i(providers_.begin()); | 696 for (ACProviders::const_iterator i(providers_.begin()); |
| 697 i != providers_.end(); ++i) { | 697 i != providers_.end(); ++i) { |
| 698 if (!(*i)->done()) | 698 if (!(*i)->done()) |
| 699 (*i)->Stop(); | 699 (*i)->Stop(); |
| 700 } | 700 } |
| 701 | 701 |
| 702 done_ = true; | 702 done_ = true; |
| 703 update_pending_ = false; | 703 update_pending_ = false; |
| 704 if (clear_result) | 704 if (clear_result) |
| 705 result_.Reset(); | 705 result_.Reset(); |
| 706 latest_result_.CopyFrom(result_); // Not strictly necessary, but keeps | 706 latest_result_.CopyFrom(result_); |
| 707 // internal state consistent. | |
| 708 coalesce_timer_.Stop(); | 707 coalesce_timer_.Stop(); |
| 709 max_delay_timer_.Stop(); | 708 max_delay_timer_.Stop(); |
| 710 } | 709 } |
| 711 | 710 |
| 712 void AutocompleteController::DeleteMatch(const AutocompleteMatch& match) { | 711 void AutocompleteController::DeleteMatch(const AutocompleteMatch& match) { |
| 713 DCHECK(match.deletable); | 712 DCHECK(match.deletable); |
| 714 match.provider->DeleteMatch(match); // This will synchronously call back to | 713 match.provider->DeleteMatch(match); // This will synchronously call back to |
| 715 // OnProviderUpdate(). | 714 // OnProviderUpdate(). |
| 716 | 715 |
| 717 // Notify observers of this change immediately, so the UI feels responsive to | 716 // Notify observers of this change immediately, so the UI feels responsive to |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 match.contents_class.push_back( | 895 match.contents_class.push_back( |
| 897 ACMatchClassification(keyword_offset + input_.text().size(), | 896 ACMatchClassification(keyword_offset + input_.text().size(), |
| 898 ACMatchClassification::NONE)); | 897 ACMatchClassification::NONE)); |
| 899 } | 898 } |
| 900 match.destination_url = | 899 match.destination_url = |
| 901 HistoryUI::GetHistoryURLWithSearchText(input_.text()); | 900 HistoryUI::GetHistoryURLWithSearchText(input_.text()); |
| 902 match.transition = PageTransition::AUTO_BOOKMARK; | 901 match.transition = PageTransition::AUTO_BOOKMARK; |
| 903 match.provider = history_contents_provider_; | 902 match.provider = history_contents_provider_; |
| 904 latest_result_.AddMatch(match); | 903 latest_result_.AddMatch(match); |
| 905 } | 904 } |
| OLD | NEW |