Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Side by Side Diff: components/omnibox/autocomplete_input.h

Issue 1098843004: Omnibox - Do Not Allow HTTP/HTTPS Equivalence if User Explicitly Entered A Scheme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: possible fix for mac code (cannot compile mac code myself) Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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. Stored in both
199 // UTF-8 and UTF-16 because both formats are necessary and we don't want
200 // to repeatedly do conversions later. Used in duplicate elimination to
201 // detect whether, for a given URL, the user may have started typing that
202 // URL with an explicit scheme; see comments on
203 // AutocompleteMatch::GURLToStrippedGURL().
204 const std::vector<std::pair<std::string, base::string16> >&
Peter Kasting 2015/06/29 05:04:59 Nit: No space between > >. (Yay C++11 language su
Mark P 2015/06/30 04:23:17 Now that it's back to a vector, I think a typedef
205 terms_prefixed_by_http_or_https() const {
206 return terms_prefixed_by_http_or_https_;
207 }
208
197 // Resets all internal variables to the null-constructed state. 209 // Resets all internal variables to the null-constructed state.
198 void Clear(); 210 void Clear();
199 211
200 private: 212 private:
201 friend class AutocompleteProviderTest; 213 friend class AutocompleteProviderTest;
202 214
203 // NOTE: Whenever adding a new field here, please make sure to update Clear() 215 // NOTE: Whenever adding a new field here, please make sure to update Clear()
204 // method. 216 // method.
205 base::string16 text_; 217 base::string16 text_;
206 size_t cursor_position_; 218 size_t cursor_position_;
207 GURL current_url_; 219 GURL current_url_;
208 metrics::OmniboxEventProto::PageClassification current_page_classification_; 220 metrics::OmniboxEventProto::PageClassification current_page_classification_;
209 metrics::OmniboxInputType::Type type_; 221 metrics::OmniboxInputType::Type type_;
210 url::Parsed parts_; 222 url::Parsed parts_;
211 base::string16 scheme_; 223 base::string16 scheme_;
212 GURL canonicalized_url_; 224 GURL canonicalized_url_;
213 bool prevent_inline_autocomplete_; 225 bool prevent_inline_autocomplete_;
214 bool prefer_keyword_; 226 bool prefer_keyword_;
215 bool allow_exact_keyword_match_; 227 bool allow_exact_keyword_match_;
216 bool want_asynchronous_matches_; 228 bool want_asynchronous_matches_;
217 bool from_omnibox_focus_; 229 bool from_omnibox_focus_;
230 std::vector<std::pair<std::string, base::string16> >
231 terms_prefixed_by_http_or_https_;
218 }; 232 };
219 233
220 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ 234 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698