| 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 #ifndef COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // See comments on |promote_type| below. | 96 // See comments on |promote_type| below. |
| 97 enum PromoteType { | 97 enum PromoteType { |
| 98 WHAT_YOU_TYPED_MATCH, | 98 WHAT_YOU_TYPED_MATCH, |
| 99 FRONT_HISTORY_MATCH, | 99 FRONT_HISTORY_MATCH, |
| 100 NEITHER, | 100 NEITHER, |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 HistoryURLProviderParams(const AutocompleteInput& input, | 103 HistoryURLProviderParams(const AutocompleteInput& input, |
| 104 bool trim_http, | 104 bool trim_http, |
| 105 const AutocompleteMatch& what_you_typed_match, | 105 const AutocompleteMatch& what_you_typed_match, |
| 106 const std::string& languages, | |
| 107 TemplateURL* default_search_provider, | 106 TemplateURL* default_search_provider, |
| 108 const SearchTermsData& search_terms_data); | 107 const SearchTermsData& search_terms_data); |
| 109 ~HistoryURLProviderParams(); | 108 ~HistoryURLProviderParams(); |
| 110 | 109 |
| 111 base::MessageLoop* message_loop; | 110 base::MessageLoop* message_loop; |
| 112 | 111 |
| 113 // A copy of the autocomplete input. We need the copy since this object will | 112 // A copy of the autocomplete input. We need the copy since this object will |
| 114 // live beyond the original query while it runs on the history thread. | 113 // live beyond the original query while it runs on the history thread. |
| 115 AutocompleteInput input; | 114 AutocompleteInput input; |
| 116 | 115 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // | 158 // |
| 160 // NOTE: The second pass of DoAutocomplete() checks what the first pass set | 159 // NOTE: The second pass of DoAutocomplete() checks what the first pass set |
| 161 // this to. See comments in DoAutocomplete(). | 160 // this to. See comments in DoAutocomplete(). |
| 162 PromoteType promote_type; | 161 PromoteType promote_type; |
| 163 | 162 |
| 164 // True if |what_you_typed_match| is eligible for display. If this is true, | 163 // True if |what_you_typed_match| is eligible for display. If this is true, |
| 165 // PromoteMatchesIfNecessary() may choose to place |what_you_typed_match| on | 164 // PromoteMatchesIfNecessary() may choose to place |what_you_typed_match| on |
| 166 // |matches_| even when |promote_type| is not WHAT_YOU_TYPED_MATCH. | 165 // |matches_| even when |promote_type| is not WHAT_YOU_TYPED_MATCH. |
| 167 bool have_what_you_typed_match; | 166 bool have_what_you_typed_match; |
| 168 | 167 |
| 169 // Languages we should pass to gfx::GetCleanStringFromUrl. | |
| 170 std::string languages; | |
| 171 | |
| 172 // The default search provider and search terms data necessary to cull results | 168 // The default search provider and search terms data necessary to cull results |
| 173 // that correspond to searches (on the default engine). These can only be | 169 // that correspond to searches (on the default engine). These can only be |
| 174 // obtained on the UI thread, so we have to copy them into here to pass them | 170 // obtained on the UI thread, so we have to copy them into here to pass them |
| 175 // to the history thread. We use a scoped_ptr<TemplateURL> for the DSP since | 171 // to the history thread. We use a scoped_ptr<TemplateURL> for the DSP since |
| 176 // TemplateURLs can't be copied by value. We use a scoped_ptr<SearchTermsData> | 172 // TemplateURLs can't be copied by value. We use a scoped_ptr<SearchTermsData> |
| 177 // so that we can store a snapshot of the SearchTermsData accessible from the | 173 // so that we can store a snapshot of the SearchTermsData accessible from the |
| 178 // history thread. | 174 // history thread. |
| 179 scoped_ptr<TemplateURL> default_search_provider; | 175 scoped_ptr<TemplateURL> default_search_provider; |
| 180 scoped_ptr<SearchTermsData> search_terms_data; | 176 scoped_ptr<SearchTermsData> search_terms_data; |
| 181 | 177 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 343 |
| 348 // Params controlling experimental behavior of this provider. | 344 // Params controlling experimental behavior of this provider. |
| 349 HUPScoringParams scoring_params_; | 345 HUPScoringParams scoring_params_; |
| 350 | 346 |
| 351 base::ThreadChecker thread_checker_; | 347 base::ThreadChecker thread_checker_; |
| 352 | 348 |
| 353 DISALLOW_COPY_AND_ASSIGN(HistoryURLProvider); | 349 DISALLOW_COPY_AND_ASSIGN(HistoryURLProvider); |
| 354 }; | 350 }; |
| 355 | 351 |
| 356 #endif // COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ | 352 #endif // COMPONENTS_OMNIBOX_BROWSER_HISTORY_URL_PROVIDER_H_ |
| OLD | NEW |