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

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: Fixed comment 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 eb3f398e0c6be6bc5d38b9fe139a0b52abcd49fc..5af89df0256609cc38fe1e75c706f6a038b97277 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc
@@ -1637,27 +1637,31 @@ void OmniboxViewGtk::EmphasizeURLComponents() {
// this input. This can tell us whether an UNKNOWN input string is going to
// be treated as a search or a navigation, and is the same method the Paste
// And Go system uses.
- url_parse::Component scheme, host;
+ url_parse::Component scheme;
+ url_parse::Component host;
Peter Kasting 2013/04/03 22:32:13 Nit: Splitting these declarations onto multiple li
Patrick Riordan 2013/04/04 01:01:37 Done.
string16 text(GetText());
AutocompleteInput::ParseForEmphasizeComponents(text, &scheme, &host);
const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0);
// Set the baseline emphasis.
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
GetTextBufferBounds(&start, &end);
gtk_text_buffer_remove_all_tags(text_buffer_, &start, &end);
if (emphasize) {
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 (!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