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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
15 | 15 |
16 class Browser; | 16 class Browser; |
17 class ToolbarActionsBar; | 17 class ToolbarActionsBar; |
18 class ToolbarActionsBarDelegate; | 18 class ToolbarActionsBarDelegate; |
19 | 19 |
20 namespace gfx { | 20 namespace gfx { |
21 class Image; | 21 class Image; |
22 class Rect; | 22 class Rect; |
23 class Size; | 23 class Size; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Sets the current width of the browser actions container without resizing | 92 // Sets the current width of the browser actions container without resizing |
93 // the underlying controller. This is to simulate e.g. when the browser window | 93 // the underlying controller. This is to simulate e.g. when the browser window |
94 // is too small for the preferred width. | 94 // is too small for the preferred width. |
95 void SetWidth(int width); | 95 void SetWidth(int width); |
96 | 96 |
97 // Returns the ToolbarActionsBar. | 97 // Returns the ToolbarActionsBar. |
98 ToolbarActionsBar* GetToolbarActionsBar(); | 98 ToolbarActionsBar* GetToolbarActionsBar(); |
99 | 99 |
100 // Creates and returns a BrowserActionTestUtil with an "overflow" container, | 100 // Creates and returns a BrowserActionTestUtil with an "overflow" container, |
101 // with this object's container as the main bar. | 101 // with this object's container as the main bar. |
102 scoped_ptr<BrowserActionTestUtil> CreateOverflowBar(); | 102 std::unique_ptr<BrowserActionTestUtil> CreateOverflowBar(); |
103 | 103 |
104 // Returns the minimum allowed size of an extension popup. | 104 // Returns the minimum allowed size of an extension popup. |
105 static gfx::Size GetMinPopupSize(); | 105 static gfx::Size GetMinPopupSize(); |
106 | 106 |
107 // Returns the maximum allowed size of an extension popup. | 107 // Returns the maximum allowed size of an extension popup. |
108 static gfx::Size GetMaxPopupSize(); | 108 static gfx::Size GetMaxPopupSize(); |
109 | 109 |
110 private: | 110 private: |
111 // A private constructor to create an overflow version. | 111 // A private constructor to create an overflow version. |
112 BrowserActionTestUtil(Browser* browser, BrowserActionTestUtil* main_bar); | 112 BrowserActionTestUtil(Browser* browser, BrowserActionTestUtil* main_bar); |
113 | 113 |
114 Browser* browser_; // weak | 114 Browser* browser_; // weak |
115 | 115 |
116 // Our test helper, which constructs and owns the views if we don't have a | 116 // Our test helper, which constructs and owns the views if we don't have a |
117 // real browser window, or if this is an overflow version. | 117 // real browser window, or if this is an overflow version. |
118 scoped_ptr<TestToolbarActionsBarHelper> test_helper_; | 118 std::unique_ptr<TestToolbarActionsBarHelper> test_helper_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(BrowserActionTestUtil); | 120 DISALLOW_COPY_AND_ASSIGN(BrowserActionTestUtil); |
121 }; | 121 }; |
122 | 122 |
123 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ | 123 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ |
OLD | NEW |