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

Unified Diff: chrome/browser/extensions/browser_action_test_util_mac.mm

Issue 10855154: Update browserAction.setIcon and pageAction.setIcon for hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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_mac.mm
diff --git a/chrome/browser/extensions/browser_action_test_util_mac.mm b/chrome/browser/extensions/browser_action_test_util_mac.mm
index 95687e8f5512442f5eeb9512e0cba460bb190a86..863806621cd8d158ea1f0575fab2bddb606c78fa 100644
--- a/chrome/browser/extensions/browser_action_test_util_mac.mm
+++ b/chrome/browser/extensions/browser_action_test_util_mac.mm
@@ -4,6 +4,7 @@
#include "chrome/browser/extensions/browser_action_test_util.h"
+#include "base/mac/foundation_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
@@ -39,6 +40,15 @@ bool BrowserActionTestUtil::HasIcon(int index) {
return [GetButton(browser_, index) image] != nil;
}
+gfx::Image BrowserActionTestUtil::GetIcon(int index) {
+ NSImage* ns_image = [GetButton(browser_, index) image];
+ // gfx::Image takes ownership of the |ns_image| reference. We have to increase
+ // the ref count so |ns_image| stays around when the image object is
+ // destroyed.
+ base::mac::NSObjectRetain(ns_image);
+ return gfx::Image(ns_image);
+}
+
void BrowserActionTestUtil::Press(int index) {
NSButton* button = GetButton(browser_, index);
[button performClick:nil];
« no previous file with comments | « chrome/browser/extensions/browser_action_test_util_gtk.cc ('k') | chrome/browser/ui/views/browser_action_test_util_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698