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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.cc

Issue 62094: Emaphasize "https" instead of "view-source" when user accesses secure/insecur... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_win.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_edit_view_win.cc (revision 13588)
+++ chrome/browser/autocomplete/autocomplete_edit_view_win.cc (working copy)
@@ -1884,9 +1884,10 @@
// this input. This can tell us whether an UNKNOWN input string is going to
// be treated as a search or a navigation, and is the same method the Paste
// And Go system uses.
- url_parse::Parsed parts;
- AutocompleteInput::Parse(GetText(), model_->GetDesiredTLD(), &parts, NULL);
- const bool emphasize = model_->CurrentTextIsURL() && (parts.host.len > 0);
+ url_parse::Component scheme, host;
+ AutocompleteInput::ParseForEmphasizeComponents(
+ GetText(), model_->GetDesiredTLD(), &scheme, &host);
+ const bool emphasize = model_->CurrentTextIsURL() && (host.len > 0);
// Set the baseline emphasis.
CHARFORMAT cf = {0};
@@ -1899,22 +1900,22 @@
if (emphasize) {
// We've found a host name, give it more emphasis.
cf.crTextColor = GetSysColor(COLOR_WINDOWTEXT);
- SetSelection(parts.host.begin, parts.host.end());
+ SetSelection(host.begin, host.end());
SetSelectionCharFormat(cf);
}
// Emphasize the scheme for security UI display purposes (if necessary).
insecure_scheme_component_.reset();
- if (!model_->user_input_in_progress() && parts.scheme.is_nonempty() &&
+ if (!model_->user_input_in_progress() && scheme.is_nonempty() &&
(scheme_security_level_ != ToolbarModel::NORMAL)) {
if (scheme_security_level_ == ToolbarModel::SECURE) {
cf.crTextColor = kSecureSchemeColor;
} else {
- insecure_scheme_component_.begin = parts.scheme.begin;
- insecure_scheme_component_.len = parts.scheme.len;
+ insecure_scheme_component_.begin = scheme.begin;
+ insecure_scheme_component_.len = scheme.len;
cf.crTextColor = kInsecureSchemeColor;
}
- SetSelection(parts.scheme.begin, parts.scheme.end());
+ SetSelection(scheme.begin, scheme.end());
SetSelectionCharFormat(cf);
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/autocomplete/autocomplete_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698