Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: chrome/browser/extensions/browser_action_test_util.h

Issue 10855154: Update browserAction.setIcon and pageAction.setIcon for hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 11
12 class Browser; 12 class Browser;
13 class ExtensionAction; 13 class ExtensionAction;
14 14
15 namespace gfx { 15 namespace gfx {
16 class Image;
16 class Rect; 17 class Rect;
17 class Size; 18 class Size;
18 } // namespace gfx 19 } // namespace gfx
19 20
20 class BrowserActionTestUtil { 21 class BrowserActionTestUtil {
21 public: 22 public:
22 explicit BrowserActionTestUtil(Browser* browser) : browser_(browser) {} 23 explicit BrowserActionTestUtil(Browser* browser) : browser_(browser) {}
23 24
24 // Returns the number of browser action buttons in the window toolbar. 25 // Returns the number of browser action buttons in the window toolbar.
25 int NumberOfBrowserActions(); 26 int NumberOfBrowserActions();
26 27
27 // Returns the number of browser action currently visible. 28 // Returns the number of browser action currently visible.
28 int VisibleBrowserActions(); 29 int VisibleBrowserActions();
29 30
30 #if defined(TOOLKIT_VIEWS) 31 #if defined(TOOLKIT_VIEWS)
31 // Returns the ExtensionAction for the given index. 32 // Returns the ExtensionAction for the given index.
32 ExtensionAction* GetExtensionAction(int index); 33 ExtensionAction* GetExtensionAction(int index);
33 #endif 34 #endif
34 35
35 // Returns whether the browser action at |index| has a non-null icon. Note 36 // Returns whether the browser action at |index| has a non-null icon. Note
36 // that the icon is loaded asynchronously, in which case you can wait for it 37 // that the icon is loaded asynchronously, in which case you can wait for it
37 // to load by calling WaitForBrowserActionUpdated. 38 // to load by calling WaitForBrowserActionUpdated.
38 bool HasIcon(int index); 39 bool HasIcon(int index);
39 40
41 // Returns icon for the browser action at |index|.
42 gfx::Image GetIcon(int index);
43
40 // Simulates a user click on the browser action button at |index|. 44 // Simulates a user click on the browser action button at |index|.
41 void Press(int index); 45 void Press(int index);
42 46
43 // Returns the extension id of the extension at |index|. 47 // Returns the extension id of the extension at |index|.
44 std::string GetExtensionId(int index); 48 std::string GetExtensionId(int index);
45 49
46 // Returns the current tooltip for the browser action button. 50 // Returns the current tooltip for the browser action button.
47 std::string GetTooltip(int index); 51 std::string GetTooltip(int index);
48 52
49 // Returns whether a browser action popup is being shown currently. 53 // Returns whether a browser action popup is being shown currently.
(...skipping 12 matching lines...) Expand all
62 static gfx::Size GetMinPopupSize(); 66 static gfx::Size GetMinPopupSize();
63 67
64 // Returns the maximum allowed size of an extension popup. 68 // Returns the maximum allowed size of an extension popup.
65 static gfx::Size GetMaxPopupSize(); 69 static gfx::Size GetMaxPopupSize();
66 70
67 private: 71 private:
68 Browser* browser_; // weak 72 Browser* browser_; // weak
69 }; 73 };
70 74
71 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ 75 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698