| 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 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 11 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 11 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 12 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" | 13 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" |
| 13 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 14 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
| 14 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" | 15 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" |
| 15 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 16 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 16 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 17 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 18 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
| 19 | 20 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 base::mac::NSObjectRetain(ns_image); | 58 base::mac::NSObjectRetain(ns_image); |
| 58 return gfx::Image(ns_image); | 59 return gfx::Image(ns_image); |
| 59 } | 60 } |
| 60 | 61 |
| 61 void BrowserActionTestUtil::Press(int index) { | 62 void BrowserActionTestUtil::Press(int index) { |
| 62 NSButton* button = GetButton(browser_, index); | 63 NSButton* button = GetButton(browser_, index); |
| 63 [button performClick:nil]; | 64 [button performClick:nil]; |
| 64 } | 65 } |
| 65 | 66 |
| 66 std::string BrowserActionTestUtil::GetExtensionId(int index) { | 67 std::string BrowserActionTestUtil::GetExtensionId(int index) { |
| 67 return [GetButton(browser_, index) extension]->id(); | 68 return [GetButton(browser_, index) viewController]->GetId(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 std::string BrowserActionTestUtil::GetTooltip(int index) { | 71 std::string BrowserActionTestUtil::GetTooltip(int index) { |
| 71 NSString* tooltip = [GetButton(browser_, index) toolTip]; | 72 NSString* tooltip = [GetButton(browser_, index) toolTip]; |
| 72 return base::SysNSStringToUTF8(tooltip); | 73 return base::SysNSStringToUTF8(tooltip); |
| 73 } | 74 } |
| 74 | 75 |
| 75 gfx::NativeView BrowserActionTestUtil::GetPopupNativeView() { | 76 gfx::NativeView BrowserActionTestUtil::GetPopupNativeView() { |
| 76 return [[ExtensionPopupController popup] view]; | 77 return [[ExtensionPopupController popup] view]; |
| 77 } | 78 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 104 | 105 |
| 105 // static | 106 // static |
| 106 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { | 107 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { |
| 107 return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize])); | 108 return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize])); |
| 108 } | 109 } |
| 109 | 110 |
| 110 // static | 111 // static |
| 111 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { | 112 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { |
| 112 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); | 113 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); |
| 113 } | 114 } |
| OLD | NEW |