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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm

Issue 440833005: MacViews: Add stubs for toolkit-views BrowserActionTestUtil functions for Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/browser_action_test_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/browser_action_test_util.h" 5 #include "chrome/browser/extensions/browser_action_test_util.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" 10 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
(...skipping 18 matching lines...) Expand all
29 NSButton* GetButton(Browser* browser, int index) { 29 NSButton* GetButton(Browser* browser, int index) {
30 return [GetController(browser) buttonWithIndex:index]; 30 return [GetController(browser) buttonWithIndex:index];
31 } 31 }
32 32
33 } // namespace 33 } // namespace
34 34
35 int BrowserActionTestUtil::NumberOfBrowserActions() { 35 int BrowserActionTestUtil::NumberOfBrowserActions() {
36 return [GetController(browser_) buttonCount]; 36 return [GetController(browser_) buttonCount];
37 } 37 }
38 38
39 ExtensionAction* BrowserActionTestUtil::GetExtensionAction(int index) {
40 NOTREACHED();
41 return NULL;
42 }
43
44 void BrowserActionTestUtil::InspectPopup(int index) {
45 NOTREACHED();
46 }
47
39 bool BrowserActionTestUtil::HasIcon(int index) { 48 bool BrowserActionTestUtil::HasIcon(int index) {
40 return [GetButton(browser_, index) image] != nil; 49 return [GetButton(browser_, index) image] != nil;
41 } 50 }
42 51
43 gfx::Image BrowserActionTestUtil::GetIcon(int index) { 52 gfx::Image BrowserActionTestUtil::GetIcon(int index) {
44 NSImage* ns_image = [GetButton(browser_, index) image]; 53 NSImage* ns_image = [GetButton(browser_, index) image];
45 // gfx::Image takes ownership of the |ns_image| reference. We have to increase 54 // gfx::Image takes ownership of the |ns_image| reference. We have to increase
46 // the ref count so |ns_image| stays around when the image object is 55 // the ref count so |ns_image| stays around when the image object is
47 // destroyed. 56 // destroyed.
48 base::mac::NSObjectRetain(ns_image); 57 base::mac::NSObjectRetain(ns_image);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return !HasPopup(); 90 return !HasPopup();
82 } 91 }
83 92
84 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { 93 gfx::Size BrowserActionTestUtil::GetMinPopupSize() {
85 return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize])); 94 return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize]));
86 } 95 }
87 96
88 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { 97 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() {
89 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); 98 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize]));
90 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/browser_action_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698