| OLD | NEW |
| 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_button.h" | 5 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" | 8 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
| 9 #include "skia/ext/skia_utils_mac.h" | 9 #include "skia/ext/skia_utils_mac.h" |
| 10 #import "third_party/molokocacao/NSBezierPath+MCAdditions.h" | 10 #import "third_party/molokocacao/NSBezierPath+MCAdditions.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 + (void)DrawBorderForPath:(NSBezierPath*)path | 238 + (void)DrawBorderForPath:(NSBezierPath*)path |
| 239 withCell:(id<ConstrainedWindowButtonDrawableCell>)cell | 239 withCell:(id<ConstrainedWindowButtonDrawableCell>)cell |
| 240 inView:(NSView*)view { | 240 inView:(NSView*)view { |
| 241 if ([[[view window] firstResponder] isEqual:view]) | 241 if ([[[view window] firstResponder] isEqual:view]) |
| 242 [[NSColor colorWithCalibratedRed:0.30 green:0.57 blue:1.0 alpha:1.0] set]; | 242 [[NSColor colorWithCalibratedRed:0.30 green:0.57 blue:1.0 alpha:1.0] set]; |
| 243 else | 243 else |
| 244 [GetButtonBorderColor(cellButtonState(cell)) set]; | 244 [GetButtonBorderColor(cellButtonState(cell)) set]; |
| 245 [path stroke]; | 245 [path stroke]; |
| 246 } | 246 } |
| 247 | 247 |
| 248 - (BOOL)canBecomeKeyView { | |
| 249 return YES; | |
| 250 } | |
| 251 | |
| 252 @end | 248 @end |
| 253 | 249 |
| 254 @implementation ConstrainedWindowButtonCell | 250 @implementation ConstrainedWindowButtonCell |
| 255 | 251 |
| 256 @synthesize isMouseInside = isMouseInside_; | 252 @synthesize isMouseInside = isMouseInside_; |
| 257 | 253 |
| 258 - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView { | 254 - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView { |
| 259 // Inset to leave room for shadow. | 255 // Inset to leave room for shadow. |
| 260 --frame.size.height; | 256 --frame.size.height; |
| 261 | 257 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 285 size.width += kButtonPaddingX * 2; | 281 size.width += kButtonPaddingX * 2; |
| 286 return size; | 282 return size; |
| 287 } | 283 } |
| 288 | 284 |
| 289 - (NSAttributedString*)getAttributedTitle { | 285 - (NSAttributedString*)getAttributedTitle { |
| 290 return GetButtonAttributedString( | 286 return GetButtonAttributedString( |
| 291 [self title], [self keyEquivalent], self); | 287 [self title], [self keyEquivalent], self); |
| 292 } | 288 } |
| 293 | 289 |
| 294 @end | 290 @end |
| OLD | NEW |