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

Side by Side Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.mm

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/constrained_window/constrained_window_alert.h" 5 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h"
6 6
7 #import "base/logging.h" 7 #import "base/logging.h"
8 #import "chrome/browser/ui/chrome_style.h" 8 #import "chrome/browser/ui/chrome_style.h"
9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h"
10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_u tils.h" 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_control_u tils.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 - (NSWindow*)window { 103 - (NSWindow*)window {
104 return window_; 104 return window_;
105 } 105 }
106 106
107 - (void)addButtonWithTitle:(NSString*)title 107 - (void)addButtonWithTitle:(NSString*)title
108 keyEquivalent:(NSString*)keyEquivalent 108 keyEquivalent:(NSString*)keyEquivalent
109 target:(id)target 109 target:(id)target
110 action:(SEL)action { 110 action:(SEL)action {
111 if (!buttons_.get()) 111 if (!buttons_.get())
112 buttons_.reset([[NSMutableArray alloc] init]); 112 buttons_.reset([[NSMutableArray alloc] init]);
113 scoped_nsobject<NSButton> button( 113 base::scoped_nsobject<NSButton> button(
114 [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]); 114 [[ConstrainedWindowButton alloc] initWithFrame:NSZeroRect]);
115 [button setTitle:title]; 115 [button setTitle:title];
116 [button setKeyEquivalent:keyEquivalent]; 116 [button setKeyEquivalent:keyEquivalent];
117 [button setTarget:target]; 117 [button setTarget:target];
118 [button setAction:action]; 118 [button setAction:action];
119 [buttons_ addObject:button]; 119 [buttons_ addObject:button];
120 [[window_ contentView] addSubview:button]; 120 [[window_ contentView] addSubview:button];
121 } 121 }
122 122
123 - (void)layout { 123 - (void)layout {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 frame.size.width = chrome_style::GetCloseButtonSize(); 221 frame.size.width = chrome_style::GetCloseButtonSize();
222 frame.size.height = chrome_style::GetCloseButtonSize(); 222 frame.size.height = chrome_style::GetCloseButtonSize();
223 frame.origin.x = windowWidth - 223 frame.origin.x = windowWidth -
224 chrome_style::kCloseButtonPadding - NSWidth(frame); 224 chrome_style::kCloseButtonPadding - NSWidth(frame);
225 frame.origin.y = windowHeight - 225 frame.origin.y = windowHeight -
226 chrome_style::kCloseButtonPadding - NSHeight(frame); 226 chrome_style::kCloseButtonPadding - NSHeight(frame);
227 [closeButton_ setFrame:frame]; 227 [closeButton_ setFrame:frame];
228 } 228 }
229 229
230 @end 230 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698