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

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

Issue 1829393002: Add keyboard accessibility to ConstrainedWindowButton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address rsesek@'s comment Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698