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

Unified Diff: chrome/browser/extensions/browser_action_test_util_gtk.cc

Issue 10855154: Update browserAction.setIcon and pageAction.setIcon for hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 4 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
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..fb5c06203e523a17312f5e211e752477dbccd473 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;
}
+uint32 BrowserActionTestUtil::GetIconID(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 will unref |pixbuf| when it goes away. Pair that unref here so
Jeffrey Yasskin 2012/08/17 23:20:28 "will unref" is a bit lower-level than I'd expect.
tbarzic 2012/08/21 00:22:07 Done.
+ // |pixbuf| stays around.
+ g_object_ref(pixbuf);
+ return gfx::Image(pixbuf).AsBitmap().getGenerationID();
Jeffrey Yasskin 2012/08/17 23:20:28 Isn't this going to return a new ID each time it's
tbarzic 2012/08/21 00:22:07 Yeah, you're probably right, but doesn't matter af
+}
+
void BrowserActionTestUtil::Press(int index) {
GtkWidget* button = GetButton(browser_, index);
gtk_button_clicked(GTK_BUTTON(button));

Powered by Google App Engine
This is Rietveld 408576698