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 |
| 11 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 11 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| 12 #define CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 12 #define CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
| 21 #include "base/memory/scoped_vector.h" | |
| 21 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 22 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
| 23 #include "chrome/browser/autocomplete/autocomplete_input.h" | 24 #include "chrome/browser/autocomplete/autocomplete_input.h" |
| 24 #include "chrome/browser/autocomplete/autocomplete_match.h" | 25 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 25 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 26 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 26 #include "chrome/browser/history/history_types.h" | 27 #include "chrome/browser/history/history_types.h" |
| 27 #include "chrome/browser/search_engines/template_url.h" | 28 #include "chrome/browser/search_engines/template_url.h" |
| 28 #include "net/url_request/url_fetcher_delegate.h" | 29 #include "net/url_request/url_fetcher_delegate.h" |
| 29 | 30 |
| 30 class Profile; | 31 class Profile; |
| 31 class SearchProviderTest; | 32 class SearchProviderTest; |
| 33 class SuggestionDeletionHandler; | |
| 32 class TemplateURLService; | 34 class TemplateURLService; |
| 33 | 35 |
| 34 namespace base { | 36 namespace base { |
| 35 class Value; | 37 class Value; |
| 36 } | 38 } |
| 37 | 39 |
| 38 namespace net { | 40 namespace net { |
| 39 class URLFetcher; | 41 class URLFetcher; |
| 40 } | 42 } |
| 41 | 43 |
| 42 // Autocomplete provider for searches and suggestions from a search engine. | 44 // Autocomplete provider for searches and suggestions from a search engine. |
| 43 // | 45 // |
| 44 // After construction, the autocomplete controller repeatedly calls Start() | 46 // After construction, the autocomplete controller repeatedly calls Start() |
| 45 // with some user input, each time expecting to receive a small set of the best | 47 // with some user input, each time expecting to receive a small set of the best |
| 46 // matches (either synchronously or asynchronously). | 48 // matches (either synchronously or asynchronously). |
| 47 // | 49 // |
| 48 // Initially the provider creates a match that searches for the current input | 50 // Initially the provider creates a match that searches for the current input |
| 49 // text. It also starts a task to query the Suggest servers. When that data | 51 // text. It also starts a task to query the Suggest servers. When that data |
| 50 // comes back, the provider creates and returns matches for the best | 52 // comes back, the provider creates and returns matches for the best |
| 51 // suggestions. | 53 // suggestions. |
| 52 class SearchProvider : public AutocompleteProvider, | 54 class SearchProvider : public AutocompleteProvider, |
| 53 public net::URLFetcherDelegate { | 55 public net::URLFetcherDelegate { |
| 54 public: | 56 public: |
| 55 // ID used in creating URLFetcher for default provider's suggest results. | 57 // ID used in creating URLFetcher for default provider's suggest results. |
| 56 static const int kDefaultProviderURLFetcherID; | 58 static const int kDefaultProviderURLFetcherID; |
| 57 | 59 |
| 58 // ID used in creating URLFetcher for keyword provider's suggest results. | 60 // ID used in creating URLFetcher for keyword provider's suggest results. |
| 59 static const int kKeywordProviderURLFetcherID; | 61 static const int kKeywordProviderURLFetcherID; |
| 60 | 62 |
| 63 // ID used in creating URLFetcher for deleting suggestion results. | |
| 64 static const int kDeletionURLFetcherID; | |
| 65 | |
| 61 SearchProvider(AutocompleteProviderListener* listener, Profile* profile); | 66 SearchProvider(AutocompleteProviderListener* listener, Profile* profile); |
| 62 | 67 |
| 63 // Returns an AutocompleteMatch with the given |autocomplete_provider|, | 68 // Returns an AutocompleteMatch with the given |autocomplete_provider|, |
| 64 // |relevance|, and |type|, which represents a search via |template_url| for | 69 // |relevance|, and |type|, which represents a search via |template_url| for |
| 65 // |query_string|. If |template_url| is NULL, returns a match with an invalid | 70 // |query_string|. If |template_url| is NULL, returns a match with an invalid |
| 66 // destination URL. | 71 // destination URL. |
| 67 // | 72 // |
| 68 // |input_text| is the original user input, which may differ from | 73 // |input_text| is the original user input, which may differ from |
| 69 // |query_string|; e.g. the user typed "foo" and got a search suggestion of | 74 // |query_string|; e.g. the user typed "foo" and got a search suggestion of |
| 70 // "food", which we're now marking up. This is used to highlight portions of | 75 // "food", which we're now marking up. This is used to highlight portions of |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 96 // Returns whether the SearchProvider previously flagged |match| as a query | 101 // Returns whether the SearchProvider previously flagged |match| as a query |
| 97 // that should be prefetched. | 102 // that should be prefetched. |
| 98 static bool ShouldPrefetch(const AutocompleteMatch& match); | 103 static bool ShouldPrefetch(const AutocompleteMatch& match); |
| 99 | 104 |
| 100 // Extracts the suggest response metadata which SearchProvider previously | 105 // Extracts the suggest response metadata which SearchProvider previously |
| 101 // stored for |match|. | 106 // stored for |match|. |
| 102 static std::string GetSuggestMetadata(const AutocompleteMatch& match); | 107 static std::string GetSuggestMetadata(const AutocompleteMatch& match); |
| 103 | 108 |
| 104 // AutocompleteProvider: | 109 // AutocompleteProvider: |
| 105 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; | 110 virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; |
| 111 virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE; | |
| 106 virtual void ResetSession() OVERRIDE; | 112 virtual void ResetSession() OVERRIDE; |
| 107 | 113 |
| 108 bool field_trial_triggered_in_session() const { | 114 bool field_trial_triggered_in_session() const { |
| 109 return field_trial_triggered_in_session_; | 115 return field_trial_triggered_in_session_; |
| 110 } | 116 } |
| 111 | 117 |
| 112 // This URL may be sent with suggest requests; see comments on CanSendURL(). | 118 // This URL may be sent with suggest requests; see comments on CanSendURL(). |
| 113 void set_current_page_url(const GURL& current_page_url) { | 119 void set_current_page_url(const GURL& current_page_url) { |
| 114 current_page_url_ = current_page_url; | 120 current_page_url_ = current_page_url; |
| 115 } | 121 } |
| 116 | 122 |
| 117 private: | 123 private: |
| 118 // TODO(hfung): Remove ZeroSuggestProvider as a friend class after | 124 // TODO(hfung): Remove ZeroSuggestProvider as a friend class after |
| 119 // refactoring common code to a new base class. | 125 // refactoring common code to a new base class. |
| 120 friend class SearchProviderTest; | 126 friend class SearchProviderTest; |
| 121 friend class ZeroSuggestProvider; | 127 friend class ZeroSuggestProvider; |
| 122 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, CanSendURL); | 128 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, CanSendURL); |
| 123 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); | 129 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInline); |
| 124 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify); | 130 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineDomainClassify); |
| 125 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring); | 131 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, NavigationInlineSchemeSubstring); |
| 126 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, RemoveStaleResultsTest); | 132 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, RemoveStaleResultsTest); |
| 127 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestRelevanceExperiment); | 133 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, SuggestRelevanceExperiment); |
| 134 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, | |
| 135 TestDeleteMatch_HasDeletionUrlSuccess); | |
| 136 FRIEND_TEST_ALL_PREFIXES(SearchProviderTest, | |
| 137 TestDeleteMatch_HasDeletionUrlFailure); | |
| 128 FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL); | 138 FRIEND_TEST_ALL_PREFIXES(AutocompleteProviderTest, GetDestinationURL); |
| 129 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, ClearPrefetchedResults); | 139 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, ClearPrefetchedResults); |
| 130 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, SetPrefetchQuery); | 140 FRIEND_TEST_ALL_PREFIXES(InstantExtendedPrefetchTest, SetPrefetchQuery); |
| 131 | 141 |
| 132 // Manages the providers (TemplateURLs) used by SearchProvider. Two providers | 142 // Manages the providers (TemplateURLs) used by SearchProvider. Two providers |
| 133 // may be used: | 143 // may be used: |
| 134 // . The default provider. This corresponds to the user's default search | 144 // . The default provider. This corresponds to the user's default search |
| 135 // engine. This is always used, except for the rare case of no default | 145 // engine. This is always used, except for the rare case of no default |
| 136 // engine. | 146 // engine. |
| 137 // . The keyword provider. This is used if the user has typed in a keyword. | 147 // . The keyword provider. This is used if the user has typed in a keyword. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 // there. | 236 // there. |
| 227 bool relevance_from_server_; | 237 bool relevance_from_server_; |
| 228 }; | 238 }; |
| 229 | 239 |
| 230 class SuggestResult : public Result { | 240 class SuggestResult : public Result { |
| 231 public: | 241 public: |
| 232 SuggestResult(const string16& suggestion, | 242 SuggestResult(const string16& suggestion, |
| 233 const string16& match_contents, | 243 const string16& match_contents, |
| 234 const string16& annotation, | 244 const string16& annotation, |
| 235 const std::string& suggest_query_params, | 245 const std::string& suggest_query_params, |
| 246 const std::string& deletion_url, | |
| 236 bool from_keyword_provider, | 247 bool from_keyword_provider, |
| 237 int relevance, | 248 int relevance, |
| 238 bool relevance_from_server, | 249 bool relevance_from_server, |
| 239 bool should_prefetch); | 250 bool should_prefetch); |
| 240 virtual ~SuggestResult(); | 251 virtual ~SuggestResult(); |
| 241 | 252 |
| 242 const string16& suggestion() const { return suggestion_; } | 253 const string16& suggestion() const { return suggestion_; } |
| 243 const string16& match_contents() const { return match_contents_; } | 254 const string16& match_contents() const { return match_contents_; } |
| 244 const string16& annotation() const { return annotation_; } | 255 const string16& annotation() const { return annotation_; } |
| 245 const std::string& suggest_query_params() const { | 256 const std::string& suggest_query_params() const { |
| 246 return suggest_query_params_; | 257 return suggest_query_params_; |
| 247 } | 258 } |
| 259 const std::string& deletion_url() const { return deletion_url_; } | |
| 248 bool should_prefetch() const { return should_prefetch_; } | 260 bool should_prefetch() const { return should_prefetch_; } |
| 249 | 261 |
| 250 // Result: | 262 // Result: |
| 251 virtual bool IsInlineable(const string16& input) const OVERRIDE; | 263 virtual bool IsInlineable(const string16& input) const OVERRIDE; |
| 252 virtual int CalculateRelevance( | 264 virtual int CalculateRelevance( |
| 253 const AutocompleteInput& input, | 265 const AutocompleteInput& input, |
| 254 bool keyword_provider_requested) const OVERRIDE; | 266 bool keyword_provider_requested) const OVERRIDE; |
| 255 | 267 |
| 256 private: | 268 private: |
| 257 // The search terms to be used for this suggestion. | 269 // The search terms to be used for this suggestion. |
| 258 string16 suggestion_; | 270 string16 suggestion_; |
| 259 | 271 |
| 260 // The contents to be displayed in the autocomplete match. | 272 // The contents to be displayed in the autocomplete match. |
| 261 string16 match_contents_; | 273 string16 match_contents_; |
| 262 | 274 |
| 263 // Optional annotation for the |match_contents_| for disambiguation. | 275 // Optional annotation for the |match_contents_| for disambiguation. |
| 264 // This may be displayed in the autocomplete match contents, but is defined | 276 // This may be displayed in the autocomplete match contents, but is defined |
| 265 // separately to facilitate different formatting. | 277 // separately to facilitate different formatting. |
| 266 string16 annotation_; | 278 string16 annotation_; |
| 267 | 279 |
| 268 // Optional additional parameters to be added to the search URL. | 280 // Optional additional parameters to be added to the search URL. |
| 269 std::string suggest_query_params_; | 281 std::string suggest_query_params_; |
| 270 | 282 |
| 283 // Optional deletion URL provided with suggestions. Fetching this URL | |
| 284 // should result in some reasonable deletion behaviour on the server, | |
| 285 // e.g. deleting this term out of a user's server-side search history. | |
| 286 std::string deletion_url_; | |
| 287 | |
| 271 // Should this result be prefetched? | 288 // Should this result be prefetched? |
| 272 bool should_prefetch_; | 289 bool should_prefetch_; |
| 273 }; | 290 }; |
| 274 | 291 |
| 275 class NavigationResult : public Result { | 292 class NavigationResult : public Result { |
| 276 public: | 293 public: |
| 277 // |provider| is necessary to use StringForURLDisplay() in order to | 294 // |provider| is necessary to use StringForURLDisplay() in order to |
| 278 // compute |formatted_url_|. | 295 // compute |formatted_url_|. |
| 279 NavigationResult(const AutocompleteProvider& provider, | 296 NavigationResult(const AutocompleteProvider& provider, |
| 280 const GURL& url, | 297 const GURL& url, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 364 bool prefer_keyword); | 381 bool prefer_keyword); |
| 365 | 382 |
| 366 // AutocompleteProvider: | 383 // AutocompleteProvider: |
| 367 virtual void Start(const AutocompleteInput& input, | 384 virtual void Start(const AutocompleteInput& input, |
| 368 bool minimal_changes) OVERRIDE; | 385 bool minimal_changes) OVERRIDE; |
| 369 virtual void Stop(bool clear_cached_results) OVERRIDE; | 386 virtual void Stop(bool clear_cached_results) OVERRIDE; |
| 370 | 387 |
| 371 // net::URLFetcherDelegate: | 388 // net::URLFetcherDelegate: |
| 372 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 389 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| 373 | 390 |
| 391 // This gets called when we have requested a suggestion deletion from the | |
| 392 // server to handle the results of the deletion. | |
| 393 virtual void OnDeletionComplete(bool success, | |
|
Peter Kasting
2013/11/27 21:58:19
Remove "virtual" on these next two functions. (No
Maria
2013/11/28 00:17:03
Done.
| |
| 394 SuggestionDeletionHandler* handler); | |
| 395 | |
| 396 // Removes the deleted match from the list of |matches_|. | |
| 397 virtual void DeleteMatchFromMatches(const AutocompleteMatch& match); | |
| 398 | |
| 374 // Called when timer_ expires. | 399 // Called when timer_ expires. |
| 375 void Run(); | 400 void Run(); |
| 376 | 401 |
| 377 // Runs the history query, if necessary. The history query is synchronous. | 402 // Runs the history query, if necessary. The history query is synchronous. |
| 378 // This does not update |done_|. | 403 // This does not update |done_|. |
| 379 void DoHistoryQuery(bool minimal_changes); | 404 void DoHistoryQuery(bool minimal_changes); |
| 380 | 405 |
| 381 // Determines whether an asynchronous subcomponent query should run for the | 406 // Determines whether an asynchronous subcomponent query should run for the |
| 382 // current input. If so, starts it if necessary; otherwise stops it. | 407 // current input. If so, starts it if necessary; otherwise stops it. |
| 383 // NOTE: This function does not update |done_|. Callers must do so. | 408 // NOTE: This function does not update |done_|. Callers must do so. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 480 | 505 |
| 481 // Calculates the relevance score for the verbatim result from the default | 506 // Calculates the relevance score for the verbatim result from the default |
| 482 // search engine *ignoring* whether the input is a keyword-based search | 507 // search engine *ignoring* whether the input is a keyword-based search |
| 483 // or not. This function should only be used to determine the minimum | 508 // or not. This function should only be used to determine the minimum |
| 484 // relevance score that the best result from this provider should have. | 509 // relevance score that the best result from this provider should have. |
| 485 // For normal use, prefer the above function. | 510 // For normal use, prefer the above function. |
| 486 int CalculateRelevanceForVerbatimIgnoringKeywordModeState() const; | 511 int CalculateRelevanceForVerbatimIgnoringKeywordModeState() const; |
| 487 | 512 |
| 488 // Gets the relevance score for the keyword verbatim result. | 513 // Gets the relevance score for the keyword verbatim result. |
| 489 // |relevance_from_server| is handled as in GetVerbatimRelevance(). | 514 // |relevance_from_server| is handled as in GetVerbatimRelevance(). |
| 490 // TODO(mpearson): Refactor so this duplication isn't necesary or | 515 // TODO(mpearson): Refactor so this duplication isn't necessary or |
| 491 // restructure so one static function takes all the parameters it needs | 516 // restructure so one static function takes all the parameters it needs |
| 492 // (rather than looking at internal state). | 517 // (rather than looking at internal state). |
| 493 int GetKeywordVerbatimRelevance(bool* relevance_from_server) const; | 518 int GetKeywordVerbatimRelevance(bool* relevance_from_server) const; |
| 494 | 519 |
| 495 // |time| is the time at which this query was last seen. |is_keyword| | 520 // |time| is the time at which this query was last seen. |is_keyword| |
| 496 // indicates whether the results correspond to the keyword provider or default | 521 // indicates whether the results correspond to the keyword provider or default |
| 497 // provider. |use_aggressive_method| says whether this function can use a | 522 // provider. |use_aggressive_method| says whether this function can use a |
| 498 // method that gives high scores (1200+) rather than one that gives lower | 523 // method that gives high scores (1200+) rather than one that gives lower |
| 499 // scores. When using the aggressive method, scores may exceed 1300 | 524 // scores. When using the aggressive method, scores may exceed 1300 |
| 500 // unless |prevent_search_history_inlining| is set. | 525 // unless |prevent_search_history_inlining| is set. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 511 bool relevance_from_server, | 536 bool relevance_from_server, |
| 512 bool should_prefetch, | 537 bool should_prefetch, |
| 513 const std::string& metadata, | 538 const std::string& metadata, |
| 514 AutocompleteMatch::Type type, | 539 AutocompleteMatch::Type type, |
| 515 bool is_keyword, | 540 bool is_keyword, |
| 516 const string16& match_contents, | 541 const string16& match_contents, |
| 517 const string16& annotation, | 542 const string16& annotation, |
| 518 const string16& query_string, | 543 const string16& query_string, |
| 519 int accepted_suggestion, | 544 int accepted_suggestion, |
| 520 const std::string& suggest_query_params, | 545 const std::string& suggest_query_params, |
| 546 const std::string& deletion_url, | |
| 521 MatchMap* map); | 547 MatchMap* map); |
| 522 | 548 |
| 523 // Returns an AutocompleteMatch for a navigational suggestion. | 549 // Returns an AutocompleteMatch for a navigational suggestion. |
| 524 AutocompleteMatch NavigationToMatch(const NavigationResult& navigation); | 550 AutocompleteMatch NavigationToMatch(const NavigationResult& navigation); |
| 525 | 551 |
| 526 // Resets the scores of all |keyword_navigation_results_| matches to | 552 // Resets the scores of all |keyword_navigation_results_| matches to |
| 527 // be below that of the top keyword query match (the verbatim match | 553 // be below that of the top keyword query match (the verbatim match |
| 528 // as expressed by |keyword_verbatim_relevance_| or keyword query | 554 // as expressed by |keyword_verbatim_relevance_| or keyword query |
| 529 // suggestions stored in |keyword_suggest_results_|). If there | 555 // suggestions stored in |keyword_suggest_results_|). If there |
| 530 // are no keyword suggestions and keyword verbatim is suppressed, | 556 // are no keyword suggestions and keyword verbatim is suppressed, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 575 // were server-provided using this key in the |additional_info| field. | 601 // were server-provided using this key in the |additional_info| field. |
| 576 static const char kRelevanceFromServerKey[]; | 602 static const char kRelevanceFromServerKey[]; |
| 577 | 603 |
| 578 // Indicates whether the server said a match should be prefetched. | 604 // Indicates whether the server said a match should be prefetched. |
| 579 static const char kShouldPrefetchKey[]; | 605 static const char kShouldPrefetchKey[]; |
| 580 | 606 |
| 581 // Used to store metadata from the server response, which is needed for | 607 // Used to store metadata from the server response, which is needed for |
| 582 // prefetching. | 608 // prefetching. |
| 583 static const char kSuggestMetadataKey[]; | 609 static const char kSuggestMetadataKey[]; |
| 584 | 610 |
| 611 // Used to store a deletion request url for server-provided suggestions. | |
| 612 static const char kDeletionUrlKey[]; | |
| 613 | |
| 585 // These are the values for the above keys. | 614 // These are the values for the above keys. |
| 586 static const char kTrue[]; | 615 static const char kTrue[]; |
| 587 static const char kFalse[]; | 616 static const char kFalse[]; |
| 588 | 617 |
| 589 // Maintains the TemplateURLs used. | 618 // Maintains the TemplateURLs used. |
| 590 Providers providers_; | 619 Providers providers_; |
| 591 | 620 |
| 592 // The user's input. | 621 // The user's input. |
| 593 AutocompleteInput input_; | 622 AutocompleteInput input_; |
| 594 | 623 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 611 base::TimeTicks time_suggest_request_sent_; | 640 base::TimeTicks time_suggest_request_sent_; |
| 612 | 641 |
| 613 // Fetchers used to retrieve results for the keyword and default providers. | 642 // Fetchers used to retrieve results for the keyword and default providers. |
| 614 scoped_ptr<net::URLFetcher> keyword_fetcher_; | 643 scoped_ptr<net::URLFetcher> keyword_fetcher_; |
| 615 scoped_ptr<net::URLFetcher> default_fetcher_; | 644 scoped_ptr<net::URLFetcher> default_fetcher_; |
| 616 | 645 |
| 617 // Results from the default and keyword search providers. | 646 // Results from the default and keyword search providers. |
| 618 Results default_results_; | 647 Results default_results_; |
| 619 Results keyword_results_; | 648 Results keyword_results_; |
| 620 | 649 |
| 650 // A vector of all deletion handlers that are currently in progress. | |
|
Peter Kasting
2013/11/27 21:58:19
Nit: How about:
Each deletion handler in this vec
Maria
2013/11/28 00:17:03
Done.
| |
| 651 ScopedVector<SuggestionDeletionHandler> deletion_handlers_; | |
|
Peter Kasting
2013/11/27 21:58:19
Nit: This should probably be a typedef.
Maria
2013/11/28 00:17:03
Not sure I understand the reason to typedef this w
Peter Kasting
2013/11/28 00:44:17
Because it's not the only place. OnDeletionComple
| |
| 652 | |
| 621 // Whether a field trial, if any, has triggered in the most recent | 653 // Whether a field trial, if any, has triggered in the most recent |
| 622 // autocomplete query. This field is set to false in Start() and may be set | 654 // autocomplete query. This field is set to false in Start() and may be set |
| 623 // to true if either the default provider or keyword provider has completed | 655 // to true if either the default provider or keyword provider has completed |
| 624 // and their corresponding suggest response contained | 656 // and their corresponding suggest response contained |
| 625 // '"google:fieldtrialtriggered":true'. | 657 // '"google:fieldtrialtriggered":true'. |
| 626 // If the autocomplete query has not returned, this field is set to false. | 658 // If the autocomplete query has not returned, this field is set to false. |
| 627 bool field_trial_triggered_; | 659 bool field_trial_triggered_; |
| 628 | 660 |
| 629 // Same as above except that it is maintained across the current Omnibox | 661 // Same as above except that it is maintained across the current Omnibox |
| 630 // session. | 662 // session. |
| 631 bool field_trial_triggered_in_session_; | 663 bool field_trial_triggered_in_session_; |
| 632 | 664 |
| 633 // If true, search history query suggestions will score low enough that | 665 // If true, search history query suggestions will score low enough that |
| 634 // they will not be inlined. | 666 // they will not be inlined. |
| 635 bool prevent_search_history_inlining_; | 667 bool prevent_search_history_inlining_; |
| 636 | 668 |
| 637 GURL current_page_url_; | 669 GURL current_page_url_; |
| 638 | 670 |
| 639 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 671 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 640 }; | 672 }; |
| 641 | 673 |
| 642 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ | 674 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ |
| OLD | NEW |