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

Unified Diff: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc

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/gtk/omnibox/omnibox_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
index 2cce44cb138b26d1d94bc9070e8272aab4ac79b7..2a65a5d7ad2cb351f7c941ca13b4b4e375fb0c4f 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
@@ -1651,24 +1651,26 @@ void OmniboxViewGtk::EmphasizeURLComponents() {
url_parse::Component scheme, host;
string16 text(GetText());
AutocompleteInput::ParseForEmphasizeComponents(text, &scheme, &host);
- const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0);
// Set the baseline emphasis.
GtkTextIter start, end;
GetTextBufferBounds(&start, &end);
gtk_text_buffer_remove_all_tags(text_buffer_, &start, &end);
- if (emphasize) {
+ 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())) {
gtk_text_buffer_apply_tag(text_buffer_, faded_text_tag_, &start, &end);
- // We've found a host name, give it more emphasis.
- gtk_text_buffer_get_iter_at_line_index(text_buffer_, &start, 0,
- GetUTF8Offset(text,
- host.begin));
- gtk_text_buffer_get_iter_at_line_index(text_buffer_, &end, 0,
- GetUTF8Offset(text,
- host.end()));
+ if (host.is_nonempty() && !toolbar_model()->ShouldGreyOutURL()) {
+ // We've found a host name, give it more emphasis.
+ gtk_text_buffer_get_iter_at_line_index(text_buffer_, &start, 0,
+ GetUTF8Offset(text,
+ host.begin));
+ gtk_text_buffer_get_iter_at_line_index(text_buffer_, &end, 0,
+ GetUTF8Offset(text,
+ host.end()));
- gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end);
+ gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end);
+ }
} else {
gtk_text_buffer_apply_tag(text_buffer_, normal_text_tag_, &start, &end);
}

Powered by Google App Engine
This is Rietveld 408576698