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

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

Issue 10396003: Add Icon Support for New Autofill Gtk UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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 | « chrome/browser/ui/gtk/gtk_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc
index 0c5a187ff5cfb367d826e9a22b22097b412ed281..da9967017a2ca6e87534daeaa9d60c00db6a5dc9 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.cc
@@ -107,16 +107,6 @@ gfx::Rect GetRectForLine(size_t line, int width) {
kHeightPerResult);
}
-// Helper for drawing an entire pixbuf without dithering.
-void DrawFullImage(cairo_t* cr, GtkWidget* widget, const gfx::Image* image,
- gint dest_x, gint dest_y) {
- gfx::CairoCachedSurface* surface = image->ToCairo();
- surface->SetSource(cr, widget, dest_x, dest_y);
- cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
- cairo_rectangle(cr, dest_x, dest_y, surface->Width(), surface->Height());
- cairo_fill(cr);
-}
-
// TODO(deanm): Find some better home for this, and make it more efficient.
size_t GetUTF8Offset(const string16& text, size_t text_offset) {
return UTF16ToUTF8(text.substr(0, text_offset)).length();
@@ -662,9 +652,10 @@ gboolean OmniboxPopupViewGtk::HandleExpose(GtkWidget* widget,
int icon_start_x = ltr ? kIconLeftPadding :
(line_rect.width() - kIconLeftPadding - kIconWidth);
// Draw the icon for this result.
- DrawFullImage(cr, widget,
- IconForMatch(*match, is_selected, is_selected_keyword),
- icon_start_x, line_rect.y() + kIconTopPadding);
+ gtk_util::DrawFullImage(cr, widget,
+ IconForMatch(*match, is_selected,
+ is_selected_keyword),
+ icon_start_x, line_rect.y() + kIconTopPadding);
// Draw the results text vertically centered in the results space.
// First draw the contents / url, but don't let it take up the whole width
@@ -738,10 +729,11 @@ gboolean OmniboxPopupViewGtk::HandleExpose(GtkWidget* widget,
icon_start_x = ltr ? (line_rect.width() - kIconLeftPadding - kIconWidth) :
kIconLeftPadding;
// Draw the icon for this result.
- DrawFullImage(cr, widget,
- theme_service_->GetImageNamed(
- is_selected ? IDR_OMNIBOX_TTS_DARK : IDR_OMNIBOX_TTS),
- icon_start_x, line_rect.y() + kIconTopPadding);
+ gtk_util::DrawFullImage(cr, widget,
+ theme_service_->GetImageNamed(
+ is_selected ? IDR_OMNIBOX_TTS_DARK :
+ IDR_OMNIBOX_TTS),
+ icon_start_x, line_rect.y() + kIconTopPadding);
}
}
« no previous file with comments | « chrome/browser/ui/gtk/gtk_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698