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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
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 #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/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ptr_util.h"
12 #include "base/path_service.h" 13 #include "base/path_service.h"
13 #include "base/strings/sys_string_conversions.h" 14 #include "base/strings/sys_string_conversions.h"
14 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
15 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" 16 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
16 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 17 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
17 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 18 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
18 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" 19 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
19 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" 20 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h"
20 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" 21 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
21 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" 22 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 [GetController(browser_, test_helper_.get()) containerView]; 191 [GetController(browser_, test_helper_.get()) containerView];
191 NSRect frame = [containerView frame]; 192 NSRect frame = [containerView frame];
192 frame.size.width = width; 193 frame.size.width = width;
193 [containerView setFrame:frame]; 194 [containerView setFrame:frame];
194 } 195 }
195 196
196 ToolbarActionsBar* BrowserActionTestUtil::GetToolbarActionsBar() { 197 ToolbarActionsBar* BrowserActionTestUtil::GetToolbarActionsBar() {
197 return [GetController(browser_, test_helper_.get()) toolbarActionsBar]; 198 return [GetController(browser_, test_helper_.get()) toolbarActionsBar];
198 } 199 }
199 200
200 scoped_ptr<BrowserActionTestUtil> BrowserActionTestUtil::CreateOverflowBar() { 201 std::unique_ptr<BrowserActionTestUtil>
202 BrowserActionTestUtil::CreateOverflowBar() {
201 CHECK(!GetToolbarActionsBar()->in_overflow_mode()) 203 CHECK(!GetToolbarActionsBar()->in_overflow_mode())
202 << "Only a main bar can create an overflow bar!"; 204 << "Only a main bar can create an overflow bar!";
203 return make_scoped_ptr(new BrowserActionTestUtil(browser_, this)); 205 return base::WrapUnique(new BrowserActionTestUtil(browser_, this));
204 } 206 }
205 207
206 // static 208 // static
207 gfx::Size BrowserActionTestUtil::GetMinPopupSize() { 209 gfx::Size BrowserActionTestUtil::GetMinPopupSize() {
208 return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize])); 210 return gfx::Size(NSSizeToCGSize([ExtensionPopupController minPopupSize]));
209 } 211 }
210 212
211 // static 213 // static
212 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { 214 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() {
213 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); 215 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize]));
214 } 216 }
215 217
216 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, 218 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser,
217 BrowserActionTestUtil* main_bar) 219 BrowserActionTestUtil* main_bar)
218 : browser_(browser), 220 : browser_(browser),
219 test_helper_(new TestToolbarActionsBarHelperCocoa( 221 test_helper_(new TestToolbarActionsBarHelperCocoa(
220 browser_, GetController(browser_, main_bar->test_helper_.get()))) { 222 browser_, GetController(browser_, main_bar->test_helper_.get()))) {
221 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698