| 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_BROWSER_AUTOCOMPLETE_INPUT_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_INPUT_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_INPUT_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_INPUT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 current_page_classification, | 76 current_page_classification, |
| 77 bool prevent_inline_autocomplete, | 77 bool prevent_inline_autocomplete, |
| 78 bool prefer_keyword, | 78 bool prefer_keyword, |
| 79 bool allow_exact_keyword_match, | 79 bool allow_exact_keyword_match, |
| 80 bool want_asynchronous_matches, | 80 bool want_asynchronous_matches, |
| 81 bool from_omnibox_focus, | 81 bool from_omnibox_focus, |
| 82 const AutocompleteSchemeClassifier& scheme_classifier); | 82 const AutocompleteSchemeClassifier& scheme_classifier); |
| 83 AutocompleteInput(const AutocompleteInput& other); | 83 AutocompleteInput(const AutocompleteInput& other); |
| 84 ~AutocompleteInput(); | 84 ~AutocompleteInput(); |
| 85 | 85 |
| 86 // If type is |FORCED_QUERY| and |text| starts with '?', it is removed. | |
| 87 // Returns number of leading characters removed. | |
| 88 static size_t RemoveForcedQueryStringIfNecessary( | |
| 89 metrics::OmniboxInputType::Type type, | |
| 90 base::string16* text); | |
| 91 | |
| 92 // Converts |type| to a string representation. Used in logging. | 86 // Converts |type| to a string representation. Used in logging. |
| 93 static std::string TypeToString(metrics::OmniboxInputType::Type type); | 87 static std::string TypeToString(metrics::OmniboxInputType::Type type); |
| 94 | 88 |
| 95 // Parses |text| (including an optional |desired_tld|) and returns the type of | 89 // Parses |text| (including an optional |desired_tld|) and returns the type of |
| 96 // input this will be interpreted as. |scheme_classifier| is used to check | 90 // input this will be interpreted as. |scheme_classifier| is used to check |
| 97 // the scheme in |text| is known and registered in the current environment. | 91 // the scheme in |text| is known and registered in the current environment. |
| 98 // The components of the input are stored in the output parameter |parts|, if | 92 // The components of the input are stored in the output parameter |parts|, if |
| 99 // it is non-NULL. The scheme is stored in |scheme| if it is non-NULL. The | 93 // it is non-NULL. The scheme is stored in |scheme| if it is non-NULL. The |
| 100 // canonicalized URL is stored in |canonicalized_url|; however, this URL is | 94 // canonicalized URL is stored in |canonicalized_url|; however, this URL is |
| 101 // not guaranteed to be valid, especially if the parsed type is, e.g., QUERY. | 95 // not guaranteed to be valid, especially if the parsed type is, e.g., QUERY. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 GURL canonicalized_url_; | 216 GURL canonicalized_url_; |
| 223 bool prevent_inline_autocomplete_; | 217 bool prevent_inline_autocomplete_; |
| 224 bool prefer_keyword_; | 218 bool prefer_keyword_; |
| 225 bool allow_exact_keyword_match_; | 219 bool allow_exact_keyword_match_; |
| 226 bool want_asynchronous_matches_; | 220 bool want_asynchronous_matches_; |
| 227 bool from_omnibox_focus_; | 221 bool from_omnibox_focus_; |
| 228 std::vector<base::string16> terms_prefixed_by_http_or_https_; | 222 std::vector<base::string16> terms_prefixed_by_http_or_https_; |
| 229 }; | 223 }; |
| 230 | 224 |
| 231 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_INPUT_H_ | 225 #endif // COMPONENTS_OMNIBOX_BROWSER_AUTOCOMPLETE_INPUT_H_ |
| OLD | NEW |