Chromium Code Reviews| 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 // This file contains the Search autocomplete provider. This provider is | 5 // This file contains the Search autocomplete provider. This provider is |
| 6 // responsible for all autocomplete entries that start with "Search <engine> | 6 // responsible for all autocomplete entries that start with "Search <engine> |
| 7 // for ...", including searching for the current input string, search | 7 // for ...", including searching for the current input string, search |
| 8 // history, and search suggestions. An instance of it gets created and | 8 // history, and search suggestions. An instance of it gets created and |
| 9 // managed by the autocomplete controller. | 9 // managed by the autocomplete controller. |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 // |suggestion.text|. |input_text| is the text the user input into the edit. | 66 // |suggestion.text|. |input_text| is the text the user input into the edit. |
| 67 // |input_text| differs from |input_.text()| if the input contained | 67 // |input_text| differs from |input_.text()| if the input contained |
| 68 // whitespace. | 68 // whitespace. |
| 69 // | 69 // |
| 70 // This method also marks the search provider as no longer needing to wait for | 70 // This method also marks the search provider as no longer needing to wait for |
| 71 // the instant result. | 71 // the instant result. |
| 72 void FinalizeInstantQuery(const string16& input_text, | 72 void FinalizeInstantQuery(const string16& input_text, |
| 73 const InstantSuggestion& suggestion); | 73 const InstantSuggestion& suggestion); |
| 74 void ClearInstantSuggestion(); | 74 void ClearInstantSuggestion(); |
| 75 | 75 |
| 76 // Sets |match| to be a search for |query|, using the default search provider | |
| 77 // or current keyword provider (based on |is_keyword|). |original_query| and | |
| 78 // |accepted_suggestion| are used to fill in AQS (Assisted Query Stats). | |
| 79 // Returns true if successful (i.e., the |match| was filled in correctly). | |
| 80 bool GetSearchWhatYouTypedMatch(const string16& query, | |
|
Peter Kasting
2013/04/12 00:29:01
I wonder if this should be static. Is it correct
sreeram
2013/04/12 22:36:18
The only new caller of this method is the one in o
Peter Kasting
2013/04/12 22:50:59
You do have to worry about pointers changing any t
| |
| 81 const string16& original_query, | |
| 82 int relevance, | |
| 83 int accepted_suggestion, | |
| 84 bool is_keyword, | |
| 85 AutocompleteMatch* match); | |
| 86 | |
| 76 // AutocompleteProvider: | 87 // AutocompleteProvider: |
| 77 virtual void Start(const AutocompleteInput& input, | 88 virtual void Start(const AutocompleteInput& input, |
| 78 bool minimal_changes) OVERRIDE; | 89 bool minimal_changes) OVERRIDE; |
| 79 virtual void Stop(bool clear_cached_results) OVERRIDE; | 90 virtual void Stop(bool clear_cached_results) OVERRIDE; |
| 80 | 91 |
| 81 // Adds search-provider-specific information to omnibox event logs. | 92 // Adds search-provider-specific information to omnibox event logs. |
| 82 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; | 93 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; |
| 83 | 94 |
| 84 // Sets |field_trial_triggered_in_session_| to false. | 95 // Sets |field_trial_triggered_in_session_| to false. |
| 85 virtual void ResetSession() OVERRIDE; | 96 virtual void ResetSession() OVERRIDE; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 bool field_trial_triggered_; | 479 bool field_trial_triggered_; |
| 469 | 480 |
| 470 // Same as above except that it is maintained across the current Omnibox | 481 // Same as above except that it is maintained across the current Omnibox |
| 471 // session. | 482 // session. |
| 472 bool field_trial_triggered_in_session_; | 483 bool field_trial_triggered_in_session_; |
| 473 | 484 |
| 474 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 485 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 475 }; | 486 }; |
| 476 | 487 |
| 477 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 488 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |