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

Side by Side Diff: components/omnibox/history_quick_provider.cc

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: use StartsWithASCII 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/history_quick_provider.h" 5 #include "components/omnibox/history_quick_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/crash_logging.h" 10 #include "base/debug/crash_logging.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // |fill_into_edit| if the user has typed an URL with a scheme and the 258 // |fill_into_edit| if the user has typed an URL with a scheme and the
259 // last character typed is a slash. That slash is removed by the 259 // last character typed is a slash. That slash is removed by the
260 // FormatURLWithOffsets call above. 260 // FormatURLWithOffsets call above.
261 if (inline_autocomplete_offset < match.fill_into_edit.length()) { 261 if (inline_autocomplete_offset < match.fill_into_edit.length()) {
262 match.inline_autocompletion = 262 match.inline_autocompletion =
263 match.fill_into_edit.substr(inline_autocomplete_offset); 263 match.fill_into_edit.substr(inline_autocomplete_offset);
264 } 264 }
265 match.allowed_to_be_default_match = match.inline_autocompletion.empty() || 265 match.allowed_to_be_default_match = match.inline_autocompletion.empty() ||
266 !PreventInlineAutocomplete(autocomplete_input_); 266 !PreventInlineAutocomplete(autocomplete_input_);
267 } 267 }
268 match.EnsureUWYTIsAllowedToBeDefault(autocomplete_input_.canonicalized_url(), 268 match.EnsureUWYTIsAllowedToBeDefault(
269 client()->GetTemplateURLService()); 269 autocomplete_input_,
270 client()->GetTemplateURLService());
270 271
271 // Format the description autocomplete presentation. 272 // Format the description autocomplete presentation.
272 match.description = info.title(); 273 match.description = info.title();
273 match.description_class = SpansFromTermMatch( 274 match.description_class = SpansFromTermMatch(
274 history_match.title_matches, match.description.length(), false); 275 history_match.title_matches, match.description.length(), false);
275 276
276 match.RecordAdditionalInfo("typed count", info.typed_count()); 277 match.RecordAdditionalInfo("typed count", info.typed_count());
277 match.RecordAdditionalInfo("visit count", info.visit_count()); 278 match.RecordAdditionalInfo("visit count", info.visit_count());
278 match.RecordAdditionalInfo("last visit", info.last_visit()); 279 match.RecordAdditionalInfo("last visit", info.last_visit());
279 280
280 return match; 281 return match;
281 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698