| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 int BrowserActionTestUtil::NumberOfBrowserActions() { | 113 int BrowserActionTestUtil::NumberOfBrowserActions() { |
| 114 return GetContainer(browser_, test_helper_.get())->num_toolbar_actions(); | 114 return GetContainer(browser_, test_helper_.get())->num_toolbar_actions(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 int BrowserActionTestUtil::VisibleBrowserActions() { | 117 int BrowserActionTestUtil::VisibleBrowserActions() { |
| 118 return GetContainer(browser_, test_helper_.get())->VisibleBrowserActions(); | 118 return GetContainer(browser_, test_helper_.get())->VisibleBrowserActions(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool BrowserActionTestUtil::IsChevronShowing() { | |
| 122 BrowserActionsContainer* container = | |
| 123 GetContainer(browser_, test_helper_.get()); | |
| 124 gfx::Size visible_size = container->GetVisibleBounds().size(); | |
| 125 return container->chevron() && | |
| 126 container->chevron()->visible() && | |
| 127 visible_size.width() >= | |
| 128 container->chevron()->GetPreferredSize().width() && | |
| 129 !visible_size.IsEmpty(); | |
| 130 } | |
| 131 | |
| 132 void BrowserActionTestUtil::InspectPopup(int index) { | 121 void BrowserActionTestUtil::InspectPopup(int index) { |
| 133 ToolbarActionView* view = | 122 ToolbarActionView* view = |
| 134 GetContainer(browser_, test_helper_.get())->GetToolbarActionViewAt(index); | 123 GetContainer(browser_, test_helper_.get())->GetToolbarActionViewAt(index); |
| 135 static_cast<ExtensionActionViewController*>(view->view_controller())-> | 124 static_cast<ExtensionActionViewController*>(view->view_controller())-> |
| 136 InspectPopup(); | 125 InspectPopup(); |
| 137 } | 126 } |
| 138 | 127 |
| 139 bool BrowserActionTestUtil::HasIcon(int index) { | 128 bool BrowserActionTestUtil::HasIcon(int index) { |
| 140 return !GetContainer(browser_, test_helper_.get()) | 129 return !GetContainer(browser_, test_helper_.get()) |
| 141 ->GetToolbarActionViewAt(index) | 130 ->GetToolbarActionViewAt(index) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); | 215 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); |
| 227 } | 216 } |
| 228 | 217 |
| 229 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, | 218 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, |
| 230 BrowserActionTestUtil* main_bar) | 219 BrowserActionTestUtil* main_bar) |
| 231 : browser_(browser), | 220 : browser_(browser), |
| 232 test_helper_(new TestToolbarActionsBarHelperViews( | 221 test_helper_(new TestToolbarActionsBarHelperViews( |
| 233 browser_, | 222 browser_, |
| 234 GetContainer(browser_, main_bar->test_helper_.get()))) { | 223 GetContainer(browser_, main_bar->test_helper_.get()))) { |
| 235 } | 224 } |
| OLD | NEW |