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

Side by Side Diff: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h" 5 #import "chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
11 11
12 #include "base/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/memory/ptr_util.h"
13 #include "base/strings/sys_string_conversions.h" 14 #include "base/strings/sys_string_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_finder.h" 17 #include "chrome/browser/ui/browser_finder.h"
17 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
18 #import "chrome/browser/ui/chrome_style.h" 19 #import "chrome/browser/ui/chrome_style.h"
19 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 20 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
20 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 21 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
21 #import "chrome/browser/ui/cocoa/browser_window_utils.h" 22 #import "chrome/browser/ui/cocoa/browser_window_utils.h"
22 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" 23 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h"
(...skipping 23 matching lines...) Expand all
46 // border. 47 // border.
47 const CGFloat kMarginX = 20.0f; 48 const CGFloat kMarginX = 20.0f;
48 const CGFloat kMarginY = 20.0f; 49 const CGFloat kMarginY = 20.0f;
49 50
50 // Distance between two views inside the bubble. 51 // Distance between two views inside the bubble.
51 const CGFloat kHorizontalPadding = 10.0f; 52 const CGFloat kHorizontalPadding = 10.0f;
52 const CGFloat kVerticalPadding = 10.0f; 53 const CGFloat kVerticalPadding = 10.0f;
53 54
54 } // namespace 55 } // namespace
55 56
56 scoped_ptr<BubbleUi> ChooserBubbleController::BuildBubbleUi() { 57 std::unique_ptr<BubbleUi> ChooserBubbleController::BuildBubbleUi() {
57 return make_scoped_ptr(new ChooserBubbleUiCocoa(browser_, this)); 58 return base::WrapUnique(new ChooserBubbleUiCocoa(browser_, this));
58 } 59 }
59 60
60 @interface ChooserBubbleUiController 61 @interface ChooserBubbleUiController
61 : BaseBubbleController<NSTableViewDataSource, NSTableViewDelegate> { 62 : BaseBubbleController<NSTableViewDataSource, NSTableViewDelegate> {
62 @private 63 @private
63 // Bridge to the C++ class that created this object. 64 // Bridge to the C++ class that created this object.
64 ChooserBubbleUiCocoa* bridge_; 65 ChooserBubbleUiCocoa* bridge_;
65 66
66 base::scoped_nsobject<NSTextField> titleView_; 67 base::scoped_nsobject<NSTextField> titleView_;
67 base::scoped_nsobject<NSScrollView> scrollView_; 68 base::scoped_nsobject<NSScrollView> scrollView_;
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 [chooser_bubble_ui_controller_ onOptionAdded:static_cast<NSInteger>(index)]; 593 [chooser_bubble_ui_controller_ onOptionAdded:static_cast<NSInteger>(index)];
593 } 594 }
594 595
595 void ChooserBubbleUiCocoa::OnOptionRemoved(size_t index) { 596 void ChooserBubbleUiCocoa::OnOptionRemoved(size_t index) {
596 [chooser_bubble_ui_controller_ onOptionRemoved:static_cast<NSInteger>(index)]; 597 [chooser_bubble_ui_controller_ onOptionRemoved:static_cast<NSInteger>(index)];
597 } 598 }
598 599
599 void ChooserBubbleUiCocoa::OnBubbleClosing() { 600 void ChooserBubbleUiCocoa::OnBubbleClosing() {
600 chooser_bubble_ui_controller_ = nil; 601 chooser_bubble_ui_controller_ = nil;
601 } 602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698