OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/split_block_button.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/split_block_button.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 @interface SplitButtonTitleCell : ConstrainedWindowButtonCell | 88 @interface SplitButtonTitleCell : ConstrainedWindowButtonCell |
89 - (NSRect)rect; | 89 - (NSRect)rect; |
90 @end | 90 @end |
91 | 91 |
92 // A button cell used by SplitBlockButton, containing the popup menu. | 92 // A button cell used by SplitBlockButton, containing the popup menu. |
93 @interface SplitButtonPopUpCell : | 93 @interface SplitButtonPopUpCell : |
94 NSPopUpButtonCell<ConstrainedWindowButtonDrawableCell> { | 94 NSPopUpButtonCell<ConstrainedWindowButtonDrawableCell> { |
95 @private | 95 @private |
96 BOOL isMouseInside_; | 96 BOOL isMouseInside_; |
97 base::scoped_nsobject<MenuController> menuController_; | 97 base::scoped_nsobject<MenuController> menuController_; |
98 scoped_ptr<ui::SimpleMenuModel> menuModel_; | 98 std::unique_ptr<ui::SimpleMenuModel> menuModel_; |
99 } | 99 } |
100 | 100 |
101 // Designated initializer. | 101 // Designated initializer. |
102 - (id)initWithMenuDelegate:(ui::SimpleMenuModel::Delegate*)menuDelegate; | 102 - (id)initWithMenuDelegate:(ui::SimpleMenuModel::Delegate*)menuDelegate; |
103 | 103 |
104 - (NSRect)rect; | 104 - (NSRect)rect; |
105 | 105 |
106 @end | 106 @end |
107 | 107 |
108 @implementation SplitBlockButton | 108 @implementation SplitBlockButton |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 [super drawBorderAndBackgroundWithFrame:NSOffsetRect(frame, -4, 0) | 332 [super drawBorderAndBackgroundWithFrame:NSOffsetRect(frame, -4, 0) |
333 inView:controlView]; | 333 inView:controlView]; |
334 } | 334 } |
335 | 335 |
336 - (NSRect)rect { | 336 - (NSRect)rect { |
337 NSSize size = [self cellSize]; | 337 NSSize size = [self cellSize]; |
338 return NSMakeRect(0, 0, std::ceil(size.width), std::ceil(size.height)); | 338 return NSMakeRect(0, 0, std::ceil(size.width), std::ceil(size.height)); |
339 } | 339 } |
340 | 340 |
341 @end | 341 @end |
OLD | NEW |