| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class BrowserActionTestUtil { | 22 class BrowserActionTestUtil { |
| 23 public: | 23 public: |
| 24 explicit BrowserActionTestUtil(Browser* browser) : browser_(browser) {} | 24 explicit BrowserActionTestUtil(Browser* browser) : browser_(browser) {} |
| 25 | 25 |
| 26 // Returns the number of browser action buttons in the window toolbar. | 26 // Returns the number of browser action buttons in the window toolbar. |
| 27 int NumberOfBrowserActions(); | 27 int NumberOfBrowserActions(); |
| 28 | 28 |
| 29 // Returns the number of browser action currently visible. | 29 // Returns the number of browser action currently visible. |
| 30 int VisibleBrowserActions(); | 30 int VisibleBrowserActions(); |
| 31 | 31 |
| 32 #if defined(TOOLKIT_VIEWS) | |
| 33 // Returns the ExtensionAction for the given index. | 32 // Returns the ExtensionAction for the given index. |
| 34 ExtensionAction* GetExtensionAction(int index); | 33 ExtensionAction* GetExtensionAction(int index); |
| 35 | 34 |
| 36 // Inspects the extension popup for the action at the given index. | 35 // Inspects the extension popup for the action at the given index. |
| 37 void InspectPopup(int index); | 36 void InspectPopup(int index); |
| 38 #endif | |
| 39 | 37 |
| 40 // Returns whether the browser action at |index| has a non-null icon. Note | 38 // Returns whether the browser action at |index| has a non-null icon. Note |
| 41 // that the icon is loaded asynchronously, in which case you can wait for it | 39 // that the icon is loaded asynchronously, in which case you can wait for it |
| 42 // to load by calling WaitForBrowserActionUpdated. | 40 // to load by calling WaitForBrowserActionUpdated. |
| 43 bool HasIcon(int index); | 41 bool HasIcon(int index); |
| 44 | 42 |
| 45 // Returns icon for the browser action at |index|. | 43 // Returns icon for the browser action at |index|. |
| 46 gfx::Image GetIcon(int index); | 44 gfx::Image GetIcon(int index); |
| 47 | 45 |
| 48 // Simulates a user click on the browser action button at |index|. | 46 // Simulates a user click on the browser action button at |index|. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 72 static gfx::Size GetMinPopupSize(); | 70 static gfx::Size GetMinPopupSize(); |
| 73 | 71 |
| 74 // Returns the maximum allowed size of an extension popup. | 72 // Returns the maximum allowed size of an extension popup. |
| 75 static gfx::Size GetMaxPopupSize(); | 73 static gfx::Size GetMaxPopupSize(); |
| 76 | 74 |
| 77 private: | 75 private: |
| 78 Browser* browser_; // weak | 76 Browser* browser_; // weak |
| 79 }; | 77 }; |
| 80 | 78 |
| 81 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ |
| OLD | NEW |