OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_action_manager.h" | 8 #include "chrome/browser/extensions/extension_action_manager.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 return extensions::ExtensionActionManager::Get(browser_->profile())-> | 37 return extensions::ExtensionActionManager::Get(browser_->profile())-> |
38 GetBrowserAction(*GetContainer(browser_)->GetBrowserActionViewAt(index)-> | 38 GetBrowserAction(*GetContainer(browser_)->GetBrowserActionViewAt(index)-> |
39 button()->extension()); | 39 button()->extension()); |
40 } | 40 } |
41 | 41 |
42 void BrowserActionTestUtil::InspectPopup(int index) { | 42 void BrowserActionTestUtil::InspectPopup(int index) { |
43 GetContainer(browser_)->InspectPopup(GetExtensionAction(index)); | 43 GetContainer(browser_)->InspectPopup(GetExtensionAction(index)); |
44 } | 44 } |
45 | 45 |
46 bool BrowserActionTestUtil::HasIcon(int index) { | 46 bool BrowserActionTestUtil::HasIcon(int index) { |
47 return GetContainer(browser_)->GetBrowserActionViewAt(index)->button()-> | 47 return !GetContainer(browser_)->GetBrowserActionViewAt(index)->button()-> |
48 HasIcon(); | 48 GetImage(views::Button::STATE_NORMAL).isNull(); |
49 } | 49 } |
50 | 50 |
51 gfx::Image BrowserActionTestUtil::GetIcon(int index) { | 51 gfx::Image BrowserActionTestUtil::GetIcon(int index) { |
52 gfx::ImageSkia icon = GetContainer(browser_)->GetBrowserActionViewAt(index)-> | 52 gfx::ImageSkia icon = GetContainer(browser_)->GetBrowserActionViewAt(index)-> |
53 button()->GetIconForTest(); | 53 button()->GetIconForTest(); |
54 return gfx::Image(icon); | 54 return gfx::Image(icon); |
55 } | 55 } |
56 | 56 |
57 void BrowserActionTestUtil::Press(int index) { | 57 void BrowserActionTestUtil::Press(int index) { |
58 GetContainer(browser_)->TestExecuteBrowserAction(index); | 58 GetContainer(browser_)->TestExecuteBrowserAction(index); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 GetContainer(browser_)->TestSetIconVisibilityCount(icons); | 92 GetContainer(browser_)->TestSetIconVisibilityCount(icons); |
93 } | 93 } |
94 | 94 |
95 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { | 95 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { |
96 return gfx::Size(ExtensionPopup::kMinWidth, ExtensionPopup::kMinHeight); | 96 return gfx::Size(ExtensionPopup::kMinWidth, ExtensionPopup::kMinHeight); |
97 } | 97 } |
98 | 98 |
99 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { | 99 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { |
100 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); | 100 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); |
101 } | 101 } |
OLD | NEW |