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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const AutocompleteInput& input, | 87 const AutocompleteInput& input, |
88 bool is_keyword, | 88 bool is_keyword, |
89 int accepted_suggestion, | 89 int accepted_suggestion, |
90 int omnibox_start_margin, | 90 int omnibox_start_margin, |
91 bool append_extra_query_params); | 91 bool append_extra_query_params); |
92 | 92 |
93 // AutocompleteProvider: | 93 // AutocompleteProvider: |
94 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; | 94 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; |
95 virtual void ResetSession() OVERRIDE; | 95 virtual void ResetSession() OVERRIDE; |
96 | 96 |
97 // Update the omnibox start margin used to generate search suggestion URLs. | |
98 void SetOmniboxStartMargin(int omnibox_start_margin); | |
99 | |
100 bool field_trial_triggered_in_session() const { | 97 bool field_trial_triggered_in_session() const { |
101 return field_trial_triggered_in_session_; | 98 return field_trial_triggered_in_session_; |
102 } | 99 } |
103 | 100 |
104 private: | 101 private: |
105 // TODO(hfung): Remove ZeroSuggestProvider as a friend class after | 102 // TODO(hfung): Remove ZeroSuggestProvider as a friend class after |
106 // refactoring common code to a new base class. | 103 // refactoring common code to a new base class. |
107 friend class SearchProviderTest; | 104 friend class SearchProviderTest; |
108 friend class ZeroSuggestProvider; | 105 friend class ZeroSuggestProvider; |
109 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); | 106 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // to true if either the default provider or keyword provider has completed | 517 // to true if either the default provider or keyword provider has completed |
521 // and their corresponding suggest response contained | 518 // and their corresponding suggest response contained |
522 // '"google:fieldtrialtriggered":true'. | 519 // '"google:fieldtrialtriggered":true'. |
523 // If the autocomplete query has not returned, this field is set to false. | 520 // If the autocomplete query has not returned, this field is set to false. |
524 bool field_trial_triggered_; | 521 bool field_trial_triggered_; |
525 | 522 |
526 // Same as above except that it is maintained across the current Omnibox | 523 // Same as above except that it is maintained across the current Omnibox |
527 // session. | 524 // session. |
528 bool field_trial_triggered_in_session_; | 525 bool field_trial_triggered_in_session_; |
529 | 526 |
530 // Start margin of the omnibox. Used to construct search URLs. | |
531 int omnibox_start_margin_; | |
532 | |
533 // If true, search history query suggestions will score low enough that | 527 // If true, search history query suggestions will score low enough that |
534 // they will not be inlined. | 528 // they will not be inlined. |
535 bool prevent_search_history_inlining_; | 529 bool prevent_search_history_inlining_; |
536 | 530 |
537 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 531 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
538 }; | 532 }; |
539 | 533 |
540 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 534 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
OLD | NEW |