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

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: revise logic 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
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:// plus
Peter Kasting 2015/06/11 05:21:44 Nit: list of words in text_ -> the terms in |text_
Mark P 2015/06/11 22:11:42 Done.
188 // at least one more characther, stored without the scheme. Used in
Peter Kasting 2015/06/11 05:21:44 Nit: character
Mark P 2015/06/11 22:11:42 Done.
189 // duplicate elimination to detect whether, for a given URL, the user may
190 // have started typing that URL with an explicit scheme; see comments on
191 // AutocompleteMatch::GURLToStrippedGURL().
192 const std::vector<base::string16>& terms_prefixed_by_http_or_https() const {
193 return terms_prefixed_by_http_or_https_;
194 }
195
187 // Resets all internal variables to the null-constructed state. 196 // Resets all internal variables to the null-constructed state.
188 void Clear(); 197 void Clear();
189 198
190 private: 199 private:
191 friend class AutocompleteProviderTest; 200 friend class AutocompleteProviderTest;
192 201
193 // NOTE: Whenever adding a new field here, please make sure to update Clear() 202 // NOTE: Whenever adding a new field here, please make sure to update Clear()
194 // method. 203 // method.
195 base::string16 text_; 204 base::string16 text_;
196 size_t cursor_position_; 205 size_t cursor_position_;
197 GURL current_url_; 206 GURL current_url_;
198 metrics::OmniboxEventProto::PageClassification current_page_classification_; 207 metrics::OmniboxEventProto::PageClassification current_page_classification_;
199 metrics::OmniboxInputType::Type type_; 208 metrics::OmniboxInputType::Type type_;
200 url::Parsed parts_; 209 url::Parsed parts_;
201 base::string16 scheme_; 210 base::string16 scheme_;
202 GURL canonicalized_url_; 211 GURL canonicalized_url_;
203 bool prevent_inline_autocomplete_; 212 bool prevent_inline_autocomplete_;
204 bool prefer_keyword_; 213 bool prefer_keyword_;
205 bool allow_exact_keyword_match_; 214 bool allow_exact_keyword_match_;
206 bool want_asynchronous_matches_; 215 bool want_asynchronous_matches_;
216 std::vector<base::string16> terms_prefixed_by_http_or_https_;
207 }; 217 };
208 218
209 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_ 219 #endif // COMPONENTS_OMNIBOX_AUTOCOMPLETE_INPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698