| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 bool allow_exact_keyword_match() const { return allow_exact_keyword_match_; } | 187 bool allow_exact_keyword_match() const { return allow_exact_keyword_match_; } |
| 188 | 188 |
| 189 // Returns whether providers should be allowed to make asynchronous requests | 189 // Returns whether providers should be allowed to make asynchronous requests |
| 190 // when processing this input. | 190 // when processing this input. |
| 191 bool want_asynchronous_matches() const { return want_asynchronous_matches_; } | 191 bool want_asynchronous_matches() const { return want_asynchronous_matches_; } |
| 192 | 192 |
| 193 // Returns whether this input query was triggered due to the omnibox being | 193 // Returns whether this input query was triggered due to the omnibox being |
| 194 // focused. | 194 // focused. |
| 195 bool from_omnibox_focus() const { return from_omnibox_focus_; } | 195 bool from_omnibox_focus() const { return from_omnibox_focus_; } |
| 196 | 196 |
| 197 // Returns the terms in |text_| that start with http:// or https:// plus |
| 198 // at least one more character, stored without the scheme. Used in |
| 199 // duplicate elimination to detect whether, for a given URL, the user may |
| 200 // have started typing that URL with an explicit scheme; see comments on |
| 201 // AutocompleteMatch::GURLToStrippedGURL(). |
| 202 const std::vector<base::string16>& terms_prefixed_by_http_or_https() const { |
| 203 return terms_prefixed_by_http_or_https_; |
| 204 } |
| 205 |
| 197 // Resets all internal variables to the null-constructed state. | 206 // Resets all internal variables to the null-constructed state. |
| 198 void Clear(); | 207 void Clear(); |
| 199 | 208 |
| 200 private: | 209 private: |
| 201 friend class AutocompleteProviderTest; | 210 friend class AutocompleteProviderTest; |
| 202 | 211 |
| 203 // NOTE: Whenever adding a new field here, please make sure to update Clear() | 212 // NOTE: Whenever adding a new field here, please make sure to update Clear() |
| 204 // method. | 213 // method. |
| 205 base::string16 text_; | 214 base::string16 text_; |
| 206 size_t cursor_position_; | 215 size_t cursor_position_; |
| 207 GURL current_url_; | 216 GURL current_url_; |
| 208 metrics::OmniboxEventProto::PageClassification current_page_classification_; | 217 metrics::OmniboxEventProto::PageClassification current_page_classification_; |
| 209 metrics::OmniboxInputType::Type type_; | 218 metrics::OmniboxInputType::Type type_; |
| 210 url::Parsed parts_; | 219 url::Parsed parts_; |
| 211 base::string16 scheme_; | 220 base::string16 scheme_; |
| 212 GURL canonicalized_url_; | 221 GURL canonicalized_url_; |
| 213 bool prevent_inline_autocomplete_; | 222 bool prevent_inline_autocomplete_; |
| 214 bool prefer_keyword_; | 223 bool prefer_keyword_; |
| 215 bool allow_exact_keyword_match_; | 224 bool allow_exact_keyword_match_; |
| 216 bool want_asynchronous_matches_; | 225 bool want_asynchronous_matches_; |
| 217 bool from_omnibox_focus_; | 226 bool from_omnibox_focus_; |
| 227 std::vector<base::string16> terms_prefixed_by_http_or_https_; |
| 218 }; | 228 }; |
| 219 | 229 |
| 220 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ | 230 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ |
| OLD | NEW |