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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc

Issue 100200: Use the new selected icons in Linux Omnibox. (Closed)
Patch Set: Shorted _selected to _s to avoid long lines. Created 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
index 72a1c78c70790f000bec295bef9c8f9edd6b8a74..1b7a50046d91478506db2454b71619c37c24dd25 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
@@ -173,34 +173,39 @@ void SetupLayoutForMatch(PangoLayout* layout,
pango_attr_list_unref(attrs);
}
-GdkPixbuf* IconForMatch(const AutocompleteMatch& match) {
+GdkPixbuf* IconForMatch(const AutocompleteMatch& match, bool selected) {
// TODO(deanm): These would be better as pixmaps someday.
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
static GdkPixbuf* o2_globe = rb.GetPixbufNamed(IDR_O2_GLOBE);
+ static GdkPixbuf* o2_globe_s = rb.GetPixbufNamed(IDR_O2_GLOBE_SELECTED);
static GdkPixbuf* o2_history = rb.GetPixbufNamed(IDR_O2_HISTORY);
+ static GdkPixbuf* o2_history_s = rb.GetPixbufNamed(IDR_O2_HISTORY_SELECTED);
static GdkPixbuf* o2_more = rb.GetPixbufNamed(IDR_O2_MORE);
+ static GdkPixbuf* o2_more_s = rb.GetPixbufNamed(IDR_O2_MORE_SELECTED);
static GdkPixbuf* o2_search = rb.GetPixbufNamed(IDR_O2_SEARCH);
+ static GdkPixbuf* o2_search_s = rb.GetPixbufNamed(IDR_O2_SEARCH_SELECTED);
static GdkPixbuf* o2_star = rb.GetPixbufNamed(IDR_O2_STAR);
+ static GdkPixbuf* o2_star_s = rb.GetPixbufNamed(IDR_O2_STAR_SELECTED);
if (match.starred)
- return o2_star;
+ return selected ? o2_star_s : o2_star;
switch (match.type) {
case AutocompleteMatch::URL_WHAT_YOU_TYPED:
case AutocompleteMatch::NAVSUGGEST:
- return o2_globe;
+ return selected ? o2_globe_s : o2_globe;
case AutocompleteMatch::HISTORY_URL:
case AutocompleteMatch::HISTORY_TITLE:
case AutocompleteMatch::HISTORY_BODY:
case AutocompleteMatch::HISTORY_KEYWORD:
- return o2_history;
+ return selected ? o2_history_s : o2_history;
case AutocompleteMatch::SEARCH_WHAT_YOU_TYPED:
case AutocompleteMatch::SEARCH_HISTORY:
case AutocompleteMatch::SEARCH_SUGGEST:
case AutocompleteMatch::SEARCH_OTHER_ENGINE:
- return o2_search;
+ return selected ? o2_search_s : o2_search;
case AutocompleteMatch::OPEN_HISTORY_PAGE:
- return o2_more;
+ return selected ? o2_more_s : o2_more;
default:
NOTREACHED();
break;
@@ -425,7 +430,7 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget,
}
// Draw the icon for this result time.
- DrawFullPixbuf(drawable, gc, IconForMatch(match),
+ DrawFullPixbuf(drawable, gc, IconForMatch(match, is_selected),
kIconLeftPadding, line_rect.y() + kIconTopPadding);
// Draw the results text vertically centered in the results space.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698