| 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 // result set that tracks the displayed matches. | 757 // result set that tracks the displayed matches. |
| 758 void Stop(bool clear_result); | 758 void Stop(bool clear_result); |
| 759 | 759 |
| 760 // Asks the relevant provider to delete |match|, and ensures observers are | 760 // Asks the relevant provider to delete |match|, and ensures observers are |
| 761 // notified of resulting changes immediately. | 761 // notified of resulting changes immediately. |
| 762 void DeleteMatch(const AutocompleteMatch& match); | 762 void DeleteMatch(const AutocompleteMatch& match); |
| 763 | 763 |
| 764 // Getters | 764 // Getters |
| 765 const AutocompleteInput& input() const { return input_; } | 765 const AutocompleteInput& input() const { return input_; } |
| 766 const AutocompleteResult& result() const { return result_; } | 766 const AutocompleteResult& result() const { return result_; } |
| 767 // This next is temporary and should go away when |
| 768 // AutocompletePopup::URLsForCurrentSelection() moves to the controller. |
| 769 const AutocompleteResult& latest_result() const { return latest_result_; } |
| 767 const bool done() const { return done_; } | 770 const bool done() const { return done_; } |
| 768 | 771 |
| 769 // From AutocompleteProvider::Listener | 772 // From AutocompleteProvider::Listener |
| 770 virtual void OnProviderUpdate(bool updated_matches); | 773 virtual void OnProviderUpdate(bool updated_matches); |
| 771 | 774 |
| 772 private: | 775 private: |
| 773 // Updates |latest_result_| and |done_| to reflect the current provider state. | 776 // Updates |latest_result_| and |done_| to reflect the current provider state. |
| 774 // Resets timers and fires notifications as necessary. |is_synchronous_pass| | 777 // Resets timers and fires notifications as necessary. |is_synchronous_pass| |
| 775 // is true only when Start() is calling this to get the synchronous results. | 778 // is true only when Start() is calling this to get the synchronous results. |
| 776 void UpdateLatestResult(bool is_synchronous_pass); | 779 void UpdateLatestResult(bool is_synchronous_pass); |
| 777 | 780 |
| 778 // Copies |latest_result_| to |result_| and notifies observers of updates. | 781 // Copies |latest_result_| to |result_| and notifies observers of updates. |
| 779 void CommitResult(); | 782 void CommitResult(); |
| 783 |
| 780 // Returns the matches from |provider| whose destination urls are not in | 784 // Returns the matches from |provider| whose destination urls are not in |
| 781 // |latest_result_|. | 785 // |latest_result_|. |
| 782 ACMatches GetMatchesNotInLatestResult( | 786 ACMatches GetMatchesNotInLatestResult( |
| 783 const AutocompleteProvider* provider) const; | 787 const AutocompleteProvider* provider) const; |
| 784 | 788 |
| 785 // If the HistoryContentsAutocomplete provider is done and there are more | 789 // If the HistoryContentsAutocomplete provider is done and there are more |
| 786 // matches in the database than currently shown, an entry is added to | 790 // matches in the database than currently shown, an entry is added to |
| 787 // |latest_result_| to show all history matches. | 791 // |latest_result_| to show all history matches. |
| 788 void AddHistoryContentsShortcut(); | 792 void AddHistoryContentsShortcut(); |
| 789 | 793 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 AutocompleteInput::Type input_type; | 851 AutocompleteInput::Type input_type; |
| 848 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). | 852 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). |
| 849 size_t selected_index; | 853 size_t selected_index; |
| 850 // Inline autocompleted length (if displayed). | 854 // Inline autocompleted length (if displayed). |
| 851 size_t inline_autocompleted_length; | 855 size_t inline_autocompleted_length; |
| 852 // Result set. | 856 // Result set. |
| 853 const AutocompleteResult& result; | 857 const AutocompleteResult& result; |
| 854 }; | 858 }; |
| 855 | 859 |
| 856 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 860 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| OLD | NEW |