| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |