diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:13:47 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:13:47 +0000 |
commit | b671760bb1967f74d584c7790af86a5aee6fd43c (patch) | |
tree | 293ed23ee335c9300dbf72b679cbaf083b41bb4f /chrome/browser/autocomplete/autocomplete_popup_view_gtk.h | |
parent | f9a2b2fe071c001a6864e527fd7035489a985243 (diff) | |
download | chromium_src-b671760bb1967f74d584c7790af86a5aee6fd43c.zip chromium_src-b671760bb1967f74d584c7790af86a5aee6fd43c.tar.gz chromium_src-b671760bb1967f74d584c7790af86a5aee6fd43c.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_gtk.h')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_gtk.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 <gtk/gtk.h> +#include <map> #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<AutocompletePopupViewGtk*>(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<const SkBitmap*, GdkPixbuf*> 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_; |