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 10 matching lines...) Expand all Loading... | |
| 21 #include "base/time.h" | 21 #include "base/time.h" |
| 22 #include "base/timer.h" | 22 #include "base/timer.h" |
| 23 #include "chrome/browser/autocomplete/autocomplete_input.h" | 23 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 24 #include "chrome/browser/autocomplete/autocomplete_match.h" | 24 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 25 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 25 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 26 #include "chrome/browser/history/history_types.h" | 26 #include "chrome/browser/history/history_types.h" |
| 27 #include "chrome/browser/search_engines/template_url.h" | 27 #include "chrome/browser/search_engines/template_url.h" |
| 28 #include "chrome/common/instant_types.h" | 28 #include "chrome/common/instant_types.h" |
| 29 #include "net/url_request/url_fetcher_delegate.h" | 29 #include "net/url_request/url_fetcher_delegate.h" |
| 30 | 30 |
| 31 class SearchProviderTest; | |
| 31 class Profile; | 32 class Profile; |
| 32 class TemplateURLService; | 33 class TemplateURLService; |
| 33 | 34 |
| 34 namespace base { | 35 namespace base { |
| 35 class Value; | 36 class Value; |
| 36 } | 37 } |
| 37 | 38 |
| 38 namespace net { | 39 namespace net { |
| 39 class URLFetcher; | 40 class URLFetcher; |
| 40 } | 41 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 return field_trial_triggered_in_session_; | 85 return field_trial_triggered_in_session_; |
| 85 } | 86 } |
| 86 | 87 |
| 87 // ID used in creating URLFetcher for default provider's suggest results. | 88 // ID used in creating URLFetcher for default provider's suggest results. |
| 88 static const int kDefaultProviderURLFetcherID; | 89 static const int kDefaultProviderURLFetcherID; |
| 89 | 90 |
| 90 // ID used in creating URLFetcher for keyword provider's suggest results. | 91 // ID used in creating URLFetcher for keyword provider's suggest results. |
| 91 static const int kKeywordProviderURLFetcherID; | 92 static const int kKeywordProviderURLFetcherID; |
| 92 | 93 |
| 93 private: | 94 private: |
| 95 friend class SearchProviderTest; | |
| 94 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestRelevanceExperiment); | 96 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestRelevanceExperiment); |
| 95 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); | 97 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); |
| 96 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring); | 98 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring); |
| 97 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify); | 99 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify); |
| 98 FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL); | 100 FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL); |
| 99 | 101 |
| 100 virtual ~SearchProvider(); | 102 virtual ~SearchProvider(); |
| 101 | 103 |
| 102 // Manages the providers (TemplateURLs) used by SearchProvider. Two providers | 104 // Manages the providers (TemplateURLs) used by SearchProvider. Two providers |
| 103 // may be used: | 105 // may be used: |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 // to true if either the default provider or keyword provider has completed | 459 // to true if either the default provider or keyword provider has completed |
| 458 // and their corresponding suggest response contained | 460 // and their corresponding suggest response contained |
| 459 // '"google:fieldtrialtriggered":true'. | 461 // '"google:fieldtrialtriggered":true'. |
| 460 // If the autocomplete query has not returned, this field is set to false. | 462 // If the autocomplete query has not returned, this field is set to false. |
| 461 bool field_trial_triggered_; | 463 bool field_trial_triggered_; |
| 462 | 464 |
| 463 // Same as above except that it is maintained across the current Omnibox | 465 // Same as above except that it is maintained across the current Omnibox |
| 464 // session. | 466 // session. |
| 465 bool field_trial_triggered_in_session_; | 467 bool field_trial_triggered_in_session_; |
| 466 | 468 |
| 469 // The amount of time to wait before sending a new suggest request after | |
| 470 // the previous one. | |
| 471 static int kMinimumTimeBetweenSuggestQueriesMs; | |
|
msw
2013/04/03 21:46:08
static class members should be listed after struct
Mark P
2013/04/03 22:51:40
Moved higher. Is the new location where you want
| |
| 472 | |
| 467 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 473 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 468 }; | 474 }; |
| 469 | 475 |
| 470 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 476 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |