| 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 |
| 248 @end | 252 @end |
| 249 | 253 |
| 250 @implementation ConstrainedWindowButtonCell | 254 @implementation ConstrainedWindowButtonCell |
| 251 | 255 |
| 252 @synthesize isMouseInside = isMouseInside_; | 256 @synthesize isMouseInside = isMouseInside_; |
| 253 | 257 |
| 254 - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView { | 258 - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView { |
| 255 // Inset to leave room for shadow. | 259 // Inset to leave room for shadow. |
| 256 --frame.size.height; | 260 --frame.size.height; |
| 257 | 261 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 281 size.width += kButtonPaddingX * 2; | 285 size.width += kButtonPaddingX * 2; |
| 282 return size; | 286 return size; |
| 283 } | 287 } |
| 284 | 288 |
| 285 - (NSAttributedString*)getAttributedTitle { | 289 - (NSAttributedString*)getAttributedTitle { |
| 286 return GetButtonAttributedString( | 290 return GetButtonAttributedString( |
| 287 [self title], [self keyEquivalent], self); | 291 [self title], [self keyEquivalent], self); |
| 288 } | 292 } |
| 289 | 293 |
| 290 @end | 294 @end |
| OLD | NEW |