Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
index 2d1ce4f33d1978b922fc0408e89c34a3eac8b3df..2966dd0d585775cd2e39dd3ff96ca58935ef917c 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc |
@@ -2463,7 +2463,8 @@ void OmniboxViewWin::EmphasizeURLComponents() { |
// 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::Component scheme, host; |
+ url_parse::Component scheme; |
+ url_parse::Component host; |
Peter Kasting
2013/04/03 22:32:13
Nit: Again, don't split these
Patrick Riordan
2013/04/04 01:01:37
Done.
|
AutocompleteInput::ParseForEmphasizeComponents(GetText(), &scheme, &host); |
const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0); |
@@ -2472,7 +2473,8 @@ void OmniboxViewWin::EmphasizeURLComponents() { |
cf.dwMask = CFM_COLOR; |
// If we're going to emphasize parts of the text, then the baseline state |
// should be "de-emphasized". If not, then everything should be rendered in |
- // the standard text color. |
+ // the standard text color. If we should grey out the entire text then |
+ // emphasize is set, but toolbar_model()->ShouldGreyOutURL() is also set. |
cf.crTextColor = skia::SkColorToCOLORREF(parent_view_->GetColor( |
security_level_, |
emphasize ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT)); |
@@ -2482,8 +2484,9 @@ void OmniboxViewWin::EmphasizeURLComponents() { |
SelectAll(false); |
SetSelectionCharFormat(cf); |
- if (emphasize) { |
- // We've found a host name, give it more emphasis. |
+ if (emphasize && !toolbar_model()->ShouldGreyOutURL()) { |
+ // We've found a host name and we should provide emphasis to host names, so |
+ // emphasize it. |
cf.crTextColor = skia::SkColorToCOLORREF(parent_view_->GetColor( |
security_level_, LocationBarView::TEXT)); |
SetSelection(host.begin, host.end()); |