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

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: Fixed mac typos and fixed unit test Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f1e054e8a237c27103455faa3fa3ba8ee747713c..985fc1a545037ee568d73410847af6eaf2552892 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 = display_text.substr(scheme.begin, scheme.len) ==
+ 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) {
+ [as addAttribute:NSForegroundColorAttributeName value:HostTextColor()
range:ComponentToNSRange(host)];
+ }
}
// TODO(shess): GTK has this as a member var, figure out why.
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698