| 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 #ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 class Browser; | 10 class Browser; |
| 11 | 11 |
| 12 namespace gfx { |
| 13 class Rect; |
| 14 class Size; |
| 15 } // namespace gfx |
| 16 |
| 12 class BrowserActionTestUtil { | 17 class BrowserActionTestUtil { |
| 13 public: | 18 public: |
| 14 explicit BrowserActionTestUtil(Browser* browser) : browser_(browser) {} | 19 explicit BrowserActionTestUtil(Browser* browser) : browser_(browser) {} |
| 15 | 20 |
| 16 // Returns the number of browser action buttons in the window toolbar. | 21 // Returns the number of browser action buttons in the window toolbar. |
| 17 int NumberOfBrowserActions(); | 22 int NumberOfBrowserActions(); |
| 18 | 23 |
| 19 // Returns whether the browser action at |index| has a non-null icon. | 24 // Returns whether the browser action at |index| has a non-null icon. |
| 20 bool HasIcon(int index); | 25 bool HasIcon(int index); |
| 21 | 26 |
| 22 // Simulates a user click on the browser action button at |index|. | 27 // Simulates a user click on the browser action button at |index|. |
| 23 void Press(int index); | 28 void Press(int index); |
| 24 | 29 |
| 25 // Returns the current tooltip for the browser action button. | 30 // Returns the current tooltip for the browser action button. |
| 26 std::string GetTooltip(int index); | 31 std::string GetTooltip(int index); |
| 27 | 32 |
| 33 // TODO(estade): http://crbug.com/29710 port to Linux |
| 34 #if !defined(TOOLKIT_GTK) |
| 35 // Returns whether a browser action popup is being shown currently. |
| 36 bool HasPopup(); |
| 37 |
| 38 // Returns the bounds of the current browser action popup. |
| 39 gfx::Rect GetPopupBounds(); |
| 40 |
| 41 // Hides the given popup and returns whether the hide was successful. |
| 42 bool HidePopup(); |
| 43 |
| 44 // Returns the minimum allowed size of an extension popup. |
| 45 static gfx::Size GetMinPopupSize(); |
| 46 |
| 47 // Returns the maximum allowed size of an extension popup. |
| 48 static gfx::Size GetMaxPopupSize(); |
| 49 #endif |
| 50 |
| 28 private: | 51 private: |
| 29 Browser* browser_; // weak | 52 Browser* browser_; // weak |
| 30 }; | 53 }; |
| 31 | 54 |
| 32 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ | 55 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ |
| OLD | NEW |