| 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 bool instant_suggest_enabled() const { return instant_suggest_enabled_; } |
| 64 void set_instant_suggest_enabled(bool value) { |
| 65 instant_suggest_enabled_ = value; |
| 66 } |
| 67 |
| 62 // Marks the instant query as done. If |input_text| is non-empty this changes | 68 // 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|. | 69 // 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 | 70 // |input_text| is the text the user input into the edit. |input_text| differs |
| 65 // from |input_.text()| if the input contained whitespace. | 71 // from |input_.text()| if the input contained whitespace. |
| 66 // | 72 // |
| 67 // This method also marks the search provider as no longer needing to wait for | 73 // This method also marks the search provider as no longer needing to wait for |
| 68 // the instant result. | 74 // the instant result. |
| 69 void FinalizeInstantQuery(const string16& input_text, | 75 void FinalizeInstantQuery(const string16& input_text, |
| 70 const string16& suggest_text); | 76 const string16& suggest_text); |
| 71 | 77 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 377 |
| 372 // Whether suggest_results_ is valid. | 378 // Whether suggest_results_ is valid. |
| 373 bool have_suggest_results_; | 379 bool have_suggest_results_; |
| 374 | 380 |
| 375 // Has FinalizeInstantQuery been invoked since the last |Start|? | 381 // Has FinalizeInstantQuery been invoked since the last |Start|? |
| 376 bool instant_finalized_; | 382 bool instant_finalized_; |
| 377 | 383 |
| 378 // The |suggest_text| parameter passed to FinalizeInstantQuery. | 384 // The |suggest_text| parameter passed to FinalizeInstantQuery. |
| 379 string16 default_provider_suggest_text_; | 385 string16 default_provider_suggest_text_; |
| 380 | 386 |
| 387 // True if Instant will autocomplete its suggestion into the omnibox. |
| 388 bool instant_suggest_enabled_; |
| 389 |
| 381 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 390 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 382 }; | 391 }; |
| 383 | 392 |
| 384 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 393 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |