From b671760bb1967f74d584c7790af86a5aee6fd43c Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Thu, 15 Jul 2010 21:13:47 +0000 Subject: Use the extension icon for extension omnibox results instead of the generic search icon. I refactored the extension menu manager to separate the icon-specific bits. BUG=46479 TEST=load the chrome search extension at src/chrome/common/extensions/docs/examples/extensions/chrome_search/ and type "src foo" into the omnibox. You should see the extension icon instead of the magnifying glass. Switch back and forth between the "src" keyword result, other results, and other keywords and the icons should update properly. Review URL: http://codereview.chromium.org/2973006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52535 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_popup_view_gtk.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_gtk.h') diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h index 4759417..2942489 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_GTK_H_ #include +#include #include "base/basictypes.h" #include "base/scoped_ptr.h" @@ -16,6 +17,7 @@ class AutocompleteEditModel; class AutocompleteEditView; +class AutocompleteMatch; class AutocompletePopupModel; class GtkThemeProvider; class Profile; @@ -56,6 +58,8 @@ class AutocompletePopupViewGtk : public AutocompletePopupView, // Accept a line of the results, for example, when the user clicks a line. void AcceptLine(size_t line, WindowOpenDisposition disposition); + GdkPixbuf* IconForMatch(const AutocompleteMatch& match, bool selected); + static gboolean HandleExposeThunk(GtkWidget* widget, GdkEventExpose* event, gpointer userdata) { return reinterpret_cast(userdata)-> @@ -99,6 +103,11 @@ class AutocompletePopupViewGtk : public AutocompletePopupView, GtkThemeProvider* theme_provider_; NotificationRegistrar registrar_; + // Used to cache GdkPixbufs and map them from the SkBitmaps they were created + // from. + typedef std::map PixbufMap; + PixbufMap pixbufs_; + // A list of colors which we should use for drawing the popup. These change // between gtk and normal mode. GdkColor border_color_; -- cgit v1.1