| 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 non-keyword autocomplete entries that start with | 6 // responsible for all non-keyword autocomplete entries that start with |
| 7 // "Search <engine> for ...", including searching for the current input string, | 7 // "Search <engine> for ...", including searching for the current input string, |
| 8 // search history, and search suggestions. An instance of it gets created and | 8 // search 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public net::URLFetcherDelegate { | 52 public net::URLFetcherDelegate { |
| 53 public: | 53 public: |
| 54 SearchProvider(AutocompleteProviderListener* listener, Profile* profile); | 54 SearchProvider(AutocompleteProviderListener* listener, Profile* profile); |
| 55 | 55 |
| 56 #if defined(UNIT_TEST) | 56 #if defined(UNIT_TEST) |
| 57 static void set_query_suggest_immediately(bool value) { | 57 static void set_query_suggest_immediately(bool value) { |
| 58 query_suggest_immediately_ = value; | 58 query_suggest_immediately_ = value; |
| 59 } | 59 } |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 // See comments for |instant_suggest_enabled_| below. |
| 63 void set_instant_suggest_enabled(bool value) { |
| 64 instant_suggest_enabled_ = value; |
| 65 } |
| 66 |
| 62 // Marks the instant query as done. If |input_text| is non-empty this changes | 67 // Marks the instant query as done. If |input_text| is non-empty this changes |
| 63 // the 'search what you typed' results text to |input_text| + |suggest_text|. | 68 // the 'search what you typed' results text to |input_text| + |suggest_text|. |
| 64 // |input_text| is the text the user input into the edit. |input_text| differs | 69 // |input_text| is the text the user input into the edit. |input_text| differs |
| 65 // from |input_.text()| if the input contained whitespace. | 70 // from |input_.text()| if the input contained whitespace. |
| 66 // | 71 // |
| 67 // This method also marks the search provider as no longer needing to wait for | 72 // This method also marks the search provider as no longer needing to wait for |
| 68 // the instant result. | 73 // the instant result. |
| 69 void FinalizeInstantQuery(const string16& input_text, | 74 void FinalizeInstantQuery(const string16& input_text, |
| 70 const string16& suggest_text); | 75 const string16& suggest_text); |
| 71 | 76 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 376 |
| 372 // Whether suggest_results_ is valid. | 377 // Whether suggest_results_ is valid. |
| 373 bool have_suggest_results_; | 378 bool have_suggest_results_; |
| 374 | 379 |
| 375 // Has FinalizeInstantQuery been invoked since the last |Start|? | 380 // Has FinalizeInstantQuery been invoked since the last |Start|? |
| 376 bool instant_finalized_; | 381 bool instant_finalized_; |
| 377 | 382 |
| 378 // The |suggest_text| parameter passed to FinalizeInstantQuery. | 383 // The |suggest_text| parameter passed to FinalizeInstantQuery. |
| 379 string16 default_provider_suggest_text_; | 384 string16 default_provider_suggest_text_; |
| 380 | 385 |
| 386 // True if Instant will autocomplete its suggestion into the omnibox. |
| 387 bool instant_suggest_enabled_; |
| 388 |
| 381 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 389 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 382 }; | 390 }; |
| 383 | 391 |
| 384 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 392 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |