Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_AUTOCOMPLETE_INPUT_H_ | 5 #ifndef COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ |
| 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ | 6 #define COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 | 177 |
| 178 // Returns whether this input is allowed to be treated as an exact | 178 // Returns whether this input is allowed to be treated as an exact |
| 179 // keyword match. If not, the default result is guaranteed not to be a | 179 // keyword match. If not, the default result is guaranteed not to be a |
| 180 // keyword search, even if the input is "<keyword> <search string>". | 180 // keyword search, even if the input is "<keyword> <search string>". |
| 181 bool allow_exact_keyword_match() const { return allow_exact_keyword_match_; } | 181 bool allow_exact_keyword_match() const { return allow_exact_keyword_match_; } |
| 182 | 182 |
| 183 // Returns whether providers should be allowed to make asynchronous requests | 183 // Returns whether providers should be allowed to make asynchronous requests |
| 184 // when processing this input. | 184 // when processing this input. |
| 185 bool want_asynchronous_matches() const { return want_asynchronous_matches_; } | 185 bool want_asynchronous_matches() const { return want_asynchronous_matches_; } |
| 186 | 186 |
| 187 // Returns list of words in text() that start with http:// or https://, | |
|
Peter Kasting
2015/06/09 20:36:39
Nit: text() -> text_
"...or https:// plus at leas
Mark P
2015/06/10 23:38:34
Done.
| |
| 188 // stored without the prefix. Used in duplicate elimination to detect | |
|
Peter Kasting
2015/06/09 20:36:39
Nit: prefix -> scheme
(Technically this is less a
Mark P
2015/06/10 23:38:34
Okay, done.
| |
| 189 // whether the user expressed interest in a particular URL with a requested | |
| 190 // scheme (and hence we shouldn't de-dup across schemes). | |
|
Peter Kasting
2015/06/09 20:36:39
Nit: How about:
"...to detect whether, for a give
Mark P
2015/06/10 23:38:34
Ah, that's good to make a reference to where the i
| |
| 191 const std::vector<base::string16>& http_following_terms() const { | |
|
Peter Kasting
2015/06/09 20:36:39
Hmm, I don't love this name... maybe terms_followi
Mark P
2015/06/10 23:38:34
The latter sounds better to me (though as you admi
| |
| 192 return http_following_terms_; | |
| 193 } | |
| 194 | |
| 187 // Resets all internal variables to the null-constructed state. | 195 // Resets all internal variables to the null-constructed state. |
| 188 void Clear(); | 196 void Clear(); |
| 189 | 197 |
| 190 private: | 198 private: |
| 191 friend class AutocompleteProviderTest; | 199 friend class AutocompleteProviderTest; |
| 192 | 200 |
| 193 // NOTE: Whenever adding a new field here, please make sure to update Clear() | 201 // NOTE: Whenever adding a new field here, please make sure to update Clear() |
| 194 // method. | 202 // method. |
| 195 base::string16 text_; | 203 base::string16 text_; |
| 196 size_t cursor_position_; | 204 size_t cursor_position_; |
| 197 GURL current_url_; | 205 GURL current_url_; |
| 198 metrics::OmniboxEventProto::PageClassification current_page_classification_; | 206 metrics::OmniboxEventProto::PageClassification current_page_classification_; |
| 199 metrics::OmniboxInputType::Type type_; | 207 metrics::OmniboxInputType::Type type_; |
| 200 url::Parsed parts_; | 208 url::Parsed parts_; |
| 201 base::string16 scheme_; | 209 base::string16 scheme_; |
| 202 GURL canonicalized_url_; | 210 GURL canonicalized_url_; |
| 203 bool prevent_inline_autocomplete_; | 211 bool prevent_inline_autocomplete_; |
| 204 bool prefer_keyword_; | 212 bool prefer_keyword_; |
| 205 bool allow_exact_keyword_match_; | 213 bool allow_exact_keyword_match_; |
| 206 bool want_asynchronous_matches_; | 214 bool want_asynchronous_matches_; |
| 215 std::vector<base::string16> http_following_terms_; | |
| 207 }; | 216 }; |
| 208 | 217 |
| 209 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ | 218 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ |
| OLD | NEW |