Chromium Code Reviews| Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
| diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
| index 2151f1648599605a9bfe6cb82ad5b671c68265c9..0479b67ff278c73ddb2a17b6004da26e36043f77 100644 |
| --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
| +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
| @@ -828,13 +828,19 @@ void OmniboxViewViews::EmphasizeURLComponents() { |
| // And Go system uses. |
| url_parse::Component scheme, host; |
| AutocompleteInput::ParseForEmphasizeComponents(text(), &scheme, &host); |
| - const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0); |
| - SetColor(location_bar_view_->GetColor(security_level_, |
| - emphasize ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT)); |
| - if (emphasize) { |
| - ApplyColor( |
| - location_bar_view_->GetColor(security_level_, LocationBarView::TEXT), |
| - ui::Range(host.begin, host.end())); |
| + if (model()->CurrentTextIsURL() && |
|
Peter Kasting
2013/04/04 21:07:05
Nit: Slightly simpler:
bool grey_base = model()
Patrick Riordan
2013/04/10 02:00:24
Done.
|
| + (host.is_nonempty() || toolbar_model()->ShouldGreyOutURL())) { |
| + SetColor(location_bar_view_->GetColor(security_level_, |
| + LocationBarView::DEEMPHASIZED_TEXT)); |
| + |
| + if (host.is_nonempty() && !toolbar_model()->ShouldGreyOutURL()) { |
| + ApplyColor( |
| + location_bar_view_->GetColor(security_level_, LocationBarView::TEXT), |
| + ui::Range(host.begin, host.end())); |
| + } |
| + } else { |
| + SetColor(location_bar_view_->GetColor(security_level_, |
| + LocationBarView::TEXT)); |
| } |
| // Emphasize the scheme for security UI display purposes (if necessary). |