| 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 #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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 | 660 |
| 661 // Asks the relevant provider to delete |match|, and ensures observers are | 661 // Asks the relevant provider to delete |match|, and ensures observers are |
| 662 // notified of resulting changes immediately. This should only be called when | 662 // notified of resulting changes immediately. This should only be called when |
| 663 // no query is running. | 663 // no query is running. |
| 664 void DeleteMatch(const AutocompleteMatch& match); | 664 void DeleteMatch(const AutocompleteMatch& match); |
| 665 | 665 |
| 666 // Removes any entries that were copied from the last result. This is used by | 666 // Removes any entries that were copied from the last result. This is used by |
| 667 // the popup to ensure it's not showing an out-of-date query. | 667 // the popup to ensure it's not showing an out-of-date query. |
| 668 void ExpireCopiedEntries(); | 668 void ExpireCopiedEntries(); |
| 669 | 669 |
| 670 // If |text| corresponds (in the sense of |
| 671 // TemplateURLModel::CleanUserInputKeyword()) to an enabled, substituting |
| 672 // keyword, returns that keyword; returns the empty string otherwise. |
| 673 string16 GetKeywordForText(const string16& text) const; |
| 674 |
| 670 #ifdef UNIT_TEST | 675 #ifdef UNIT_TEST |
| 671 void set_search_provider(SearchProvider* provider) { | 676 void set_search_provider(SearchProvider* provider) { |
| 672 search_provider_ = provider; | 677 search_provider_ = provider; |
| 673 } | 678 } |
| 674 #endif | 679 #endif |
| 675 SearchProvider* search_provider() const { return search_provider_; } | 680 SearchProvider* search_provider() const { return search_provider_; } |
| 676 | 681 |
| 677 // Getters | 682 // Getters |
| 678 const AutocompleteInput& input() const { return input_; } | 683 const AutocompleteInput& input() const { return input_; } |
| 679 const AutocompleteResult& result() const { return result_; } | 684 const AutocompleteResult& result() const { return result_; } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 // Input passed to Start. | 719 // Input passed to Start. |
| 715 AutocompleteInput input_; | 720 AutocompleteInput input_; |
| 716 | 721 |
| 717 // Data from the autocomplete query. | 722 // Data from the autocomplete query. |
| 718 AutocompleteResult result_; | 723 AutocompleteResult result_; |
| 719 | 724 |
| 720 // Timer used to remove any matches copied from the last result. When run | 725 // Timer used to remove any matches copied from the last result. When run |
| 721 // invokes |ExpireCopiedEntries|. | 726 // invokes |ExpireCopiedEntries|. |
| 722 base::OneShotTimer<AutocompleteController> expire_timer_; | 727 base::OneShotTimer<AutocompleteController> expire_timer_; |
| 723 | 728 |
| 729 Profile* profile_; |
| 730 |
| 724 // True if a query is not currently running. | 731 // True if a query is not currently running. |
| 725 bool done_; | 732 bool done_; |
| 726 | 733 |
| 727 // Are we in Start()? This is used to avoid updating |result_| and sending | 734 // Are we in Start()? This is used to avoid updating |result_| and sending |
| 728 // notifications until Start() has been invoked on all providers. | 735 // notifications until Start() has been invoked on all providers. |
| 729 bool in_start_; | 736 bool in_start_; |
| 730 | 737 |
| 731 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); | 738 DISALLOW_COPY_AND_ASSIGN(AutocompleteController); |
| 732 }; | 739 }; |
| 733 | 740 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 753 AutocompleteInput::Type input_type; | 760 AutocompleteInput::Type input_type; |
| 754 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). | 761 // Selected index (if selected) or -1 (AutocompletePopupModel::kNoMatch). |
| 755 size_t selected_index; | 762 size_t selected_index; |
| 756 // Inline autocompleted length (if displayed). | 763 // Inline autocompleted length (if displayed). |
| 757 size_t inline_autocompleted_length; | 764 size_t inline_autocompleted_length; |
| 758 // Result set. | 765 // Result set. |
| 759 const AutocompleteResult& result; | 766 const AutocompleteResult& result; |
| 760 }; | 767 }; |
| 761 | 768 |
| 762 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ | 769 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_H_ |
| OLD | NEW |