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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm

Issue 12463042: Shows chrome-extension urls and greys out the whole url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementation does not depend on having a host and fixed nits. Created 7 years, 9 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
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 3e1140fd3c8477c429bf8a1dc67444f913b6a403..b5daee62292736066b05b841fc020c7969f820c2 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -450,13 +450,15 @@ 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) {
+ if (model()->currentTextIsURL() &&
+ (host.is_nonempty() || toolbar_model()->ShouldGreyOutURL())) {
[as addAttribute:NSForegroundColorAttributeName value:BaseTextColor()
range:as_entire_string];
- [as addAttribute:NSForegroundColorAttributeName value:HostTextColor()
+ if (host.is_nonempty() && !toolbar_model()->ShouldGreyOutURL()) {
Peter Kasting 2013/04/04 21:07:05 Nit: No need to add the first clause, it will alwa
Patrick Riordan 2013/04/10 02:00:24 Done.
+ [as addAttribute:NSForegroundColorAttributeName value:HostTextColor()
range:ComponentToNSRange(host)];
+ }
}
// TODO(shess): GTK has this as a member var, figure out why.

Powered by Google App Engine
This is Rietveld 408576698