Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
index b2d44dfffd1b3322b37b344429c5089a91aa77bd..af5d95266b6df8a63c7a527d5673c23da19aa029 100644 |
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
@@ -23,6 +23,7 @@ |
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
#include "chrome/browser/ui/toolbar/toolbar_model.h" |
#include "content/public/browser/web_contents.h" |
+#include "extensions/common/constants.h" |
#include "grit/generated_resources.h" |
#include "grit/theme_resources.h" |
#import "third_party/mozilla/NSPasteboard+Utils.h" |
@@ -448,13 +449,17 @@ void OmniboxViewMac::ApplyTextAttributes(const string16& display_text, |
url_parse::Component scheme, host; |
AutocompleteInput::ParseForEmphasizeComponents( |
display_text, &scheme, &host); |
- const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0); |
- if (emphasize) { |
+ bool grey_out_url = GetText().substr(scheme.begin, scheme.len) == |
Peter Kasting
2013/04/11 23:10:40
Use |display_text| here instead of GetText().
Patrick Riordan
2013/04/11 23:27:38
Done.
Sorry. This patch set was sloppy.
|
+ UTF8toUTF16(extensions::kExtensionScheme); |
+ if (model()->currentTextIsURL() && |
+ (host.is_nonempty() || grey_out_url)) { |
[as addAttribute:NSForegroundColorAttributeName value:BaseTextColor() |
range:as_entire_string]; |
- [as addAttribute:NSForegroundColorAttributeName value:HostTextColor() |
+ if (grey_out_url) { |
Peter Kasting
2013/04/11 23:10:40
Isn't this conditional backwards?
Patrick Riordan
2013/04/11 23:27:38
Done.
|
+ [as addAttribute:NSForegroundColorAttributeName value:HostTextColor() |
range:ComponentToNSRange(host)]; |
+ } |
} |
// TODO(shess): GTK has this as a member var, figure out why. |