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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ->GetToolbarActionViewAt(index) | 197 ->GetToolbarActionViewAt(index) |
198 ->wants_to_run_for_testing(); | 198 ->wants_to_run_for_testing(); |
199 } | 199 } |
200 | 200 |
201 void BrowserActionTestUtil::SetWidth(int width) { | 201 void BrowserActionTestUtil::SetWidth(int width) { |
202 BrowserActionsContainer* container = | 202 BrowserActionsContainer* container = |
203 GetContainer(browser_, test_helper_.get()); | 203 GetContainer(browser_, test_helper_.get()); |
204 container->SetSize(gfx::Size(width, container->height())); | 204 container->SetSize(gfx::Size(width, container->height())); |
205 } | 205 } |
206 | 206 |
| 207 bool BrowserActionTestUtil::IsHighlightingForSurfacingBubble() { |
| 208 return GetContainer(browser_, test_helper_.get()) |
| 209 ->toolbar_actions_bar() |
| 210 ->is_highlighting(); |
| 211 } |
| 212 |
207 ToolbarActionsBar* BrowserActionTestUtil::GetToolbarActionsBar() { | 213 ToolbarActionsBar* BrowserActionTestUtil::GetToolbarActionsBar() { |
208 return GetContainer(browser_, test_helper_.get())->toolbar_actions_bar(); | 214 return GetContainer(browser_, test_helper_.get())->toolbar_actions_bar(); |
209 } | 215 } |
210 | 216 |
211 scoped_ptr<BrowserActionTestUtil> BrowserActionTestUtil::CreateOverflowBar() { | 217 scoped_ptr<BrowserActionTestUtil> BrowserActionTestUtil::CreateOverflowBar() { |
212 CHECK(!GetToolbarActionsBar()->in_overflow_mode()) | 218 CHECK(!GetToolbarActionsBar()->in_overflow_mode()) |
213 << "Only a main bar can create an overflow bar!"; | 219 << "Only a main bar can create an overflow bar!"; |
214 return make_scoped_ptr(new BrowserActionTestUtil(browser_, this)); | 220 return make_scoped_ptr(new BrowserActionTestUtil(browser_, this)); |
215 } | 221 } |
216 | 222 |
217 // static | 223 // static |
218 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { | 224 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { |
219 return gfx::Size(ExtensionPopup::kMinWidth, ExtensionPopup::kMinHeight); | 225 return gfx::Size(ExtensionPopup::kMinWidth, ExtensionPopup::kMinHeight); |
220 } | 226 } |
221 | 227 |
222 // static | 228 // static |
223 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { | 229 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { |
224 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); | 230 return gfx::Size(ExtensionPopup::kMaxWidth, ExtensionPopup::kMaxHeight); |
225 } | 231 } |
226 | 232 |
227 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, | 233 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, |
228 BrowserActionTestUtil* main_bar) | 234 BrowserActionTestUtil* main_bar) |
229 : browser_(browser), | 235 : browser_(browser), |
230 test_helper_(new TestToolbarActionsBarHelperViews( | 236 test_helper_(new TestToolbarActionsBarHelperViews( |
231 browser_, | 237 browser_, |
232 GetContainer(browser_, main_bar->test_helper_.get()))) { | 238 GetContainer(browser_, main_bar->test_helper_.get()))) { |
233 } | 239 } |
OLD | NEW |