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 #include "components/omnibox/browser/autocomplete_input.h" | 5 #include "components/omnibox/browser/autocomplete_input.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 base::string16 trimmed_text; | 128 base::string16 trimmed_text; |
129 if ((base::TrimWhitespace(text_, base::TRIM_LEADING, &trimmed_text) & | 129 if ((base::TrimWhitespace(text_, base::TRIM_LEADING, &trimmed_text) & |
130 base::TRIM_LEADING) != 0) { | 130 base::TRIM_LEADING) != 0) { |
131 AdjustCursorPositionIfNecessary(text_.length() - trimmed_text.length(), | 131 AdjustCursorPositionIfNecessary(text_.length() - trimmed_text.length(), |
132 &cursor_position_); | 132 &cursor_position_); |
133 text_ = trimmed_text; | 133 text_ = trimmed_text; |
134 } | 134 } |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
| 138 AutocompleteInput::AutocompleteInput(const AutocompleteInput& other) = default; |
| 139 |
138 AutocompleteInput::~AutocompleteInput() { | 140 AutocompleteInput::~AutocompleteInput() { |
139 } | 141 } |
140 | 142 |
141 // static | 143 // static |
142 size_t AutocompleteInput::RemoveForcedQueryStringIfNecessary( | 144 size_t AutocompleteInput::RemoveForcedQueryStringIfNecessary( |
143 metrics::OmniboxInputType::Type type, | 145 metrics::OmniboxInputType::Type type, |
144 base::string16* text) { | 146 base::string16* text) { |
145 if ((type != metrics::OmniboxInputType::FORCED_QUERY) || text->empty() || | 147 if ((type != metrics::OmniboxInputType::FORCED_QUERY) || text->empty() || |
146 (*text)[0] != L'?') | 148 (*text)[0] != L'?') |
147 return 0; | 149 return 0; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 parts_ = url::Parsed(); | 568 parts_ = url::Parsed(); |
567 scheme_.clear(); | 569 scheme_.clear(); |
568 canonicalized_url_ = GURL(); | 570 canonicalized_url_ = GURL(); |
569 prevent_inline_autocomplete_ = false; | 571 prevent_inline_autocomplete_ = false; |
570 prefer_keyword_ = false; | 572 prefer_keyword_ = false; |
571 allow_exact_keyword_match_ = false; | 573 allow_exact_keyword_match_ = false; |
572 want_asynchronous_matches_ = true; | 574 want_asynchronous_matches_ = true; |
573 from_omnibox_focus_ = false; | 575 from_omnibox_focus_ = false; |
574 terms_prefixed_by_http_or_https_.clear(); | 576 terms_prefixed_by_http_or_https_.clear(); |
575 } | 577 } |
OLD | NEW |