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

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: . 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_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 2eeeffc927f96fab56e15399c1be71ae2c858cf6..53cd8e6f00291dcafb1d26a6f8f5ce8fb1a87988 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 "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];

Powered by Google App Engine
This is Rietveld 408576698