| Index: chrome/browser/extensions/browser_action_test_util_gtk.cc
|
| diff --git a/chrome/browser/extensions/browser_action_test_util_gtk.cc b/chrome/browser/extensions/browser_action_test_util_gtk.cc
|
| index ccf6411aec9ed0454053be61b6301f13c9f27990..3aed0a8084a2882d630e589856df180c549c467b 100644
|
| --- a/chrome/browser/extensions/browser_action_test_util_gtk.cc
|
| +++ b/chrome/browser/extensions/browser_action_test_util_gtk.cc
|
| @@ -11,6 +11,7 @@
|
| #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h"
|
| #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h"
|
| #include "chrome/browser/ui/gtk/view_id_util.h"
|
| +#include "ui/gfx/image/image.h"
|
|
|
| namespace {
|
|
|
| @@ -49,6 +50,16 @@ bool BrowserActionTestUtil::HasIcon(int index) {
|
| return gtk_button_get_image(GTK_BUTTON(button)) != NULL;
|
| }
|
|
|
| +gfx::Image BrowserActionTestUtil::GetIcon(int index) {
|
| + GtkWidget* button = GetButton(browser_, index);
|
| + GtkWidget* image = gtk_button_get_image(GTK_BUTTON(button));
|
| + GdkPixbuf* pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(image));
|
| + // gfx::Image takes ownership of the |pixbuf| reference. We have to increase
|
| + // the ref count so |pixbuf| stays around when the image object is destroyed.
|
| + g_object_ref(pixbuf);
|
| + return gfx::Image(pixbuf);
|
| +}
|
| +
|
| void BrowserActionTestUtil::Press(int index) {
|
| GtkWidget* button = GetButton(browser_, index);
|
| gtk_button_clicked(GTK_BUTTON(button));
|
|
|