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 480e459abc32ec833957fe923653607f5b1e2fe3..97f86c2025a4b0fdea7c52b3771b2cb25cbd82ee 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
@@ -22,6 +22,7 @@ |
#include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
#include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" |
#include "content/public/browser/web_contents.h" |
+#include "extensions/common/constants.h" |
#include "googleurl/src/gurl.h" |
#include "grit/app_locale_settings.h" |
#include "grit/generated_resources.h" |
@@ -846,10 +847,14 @@ 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) { |
+ bool grey_out_url = GetText().substr(scheme.begin, scheme.len) == |
Peter Kasting
2013/04/11 23:10:40
Use text() here instead of GetText().
Patrick Riordan
2013/04/11 23:27:38
Done.
|
+ UTF8ToUTF16(extensions::kExtensionScheme); |
+ bool grey_base = model()->CurrentTextIsURL() && |
+ (host.is_nonempty() || grey_out_url); |
+ SetColor(location_bar_view_->GetColor( |
+ security_level_, |
+ grey_base ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT)); |
+ if (grey_base && !grey_out_url) { |
ApplyColor( |
location_bar_view_->GetColor(security_level_, LocationBarView::TEXT), |
ui::Range(host.begin, host.end())); |