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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm

Issue 1327203003: Mac: Fix missing focus rings on toolbar, profile, and tab buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Created 5 years, 3 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
OLDNEW
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/profiles/avatar_button_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (isThemedWindow_) 107 if (isThemedWindow_)
108 imageIds = kThemedBorderImageIds; 108 imageIds = kThemedBorderImageIds;
109 109
110 if (hoverState == kHoverStateMouseDown) 110 if (hoverState == kHoverStateMouseDown)
111 imageIds = kPressedBorderImageIds; 111 imageIds = kPressedBorderImageIds;
112 else if (hoverState == kHoverStateMouseOver) 112 else if (hoverState == kHoverStateMouseOver)
113 imageIds = kHoverBorderImageIds; 113 imageIds = kHoverBorderImageIds;
114 ui::DrawNinePartImage(frame, imageIds, NSCompositeSourceOver, 1.0, true); 114 ui::DrawNinePartImage(frame, imageIds, NSCompositeSourceOver, 1.0, true);
115 } 115 }
116 116
117 - (void)drawFocusRingMaskWithFrame:(NSRect)frame inView:(NSView*)view {
118 // Match the bezel's shape.
119 [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(frame, 2, 2)
120 xRadius:2
121 yRadius:2] fill];
122 }
123
117 - (void)setIsThemedWindow:(BOOL)isThemedWindow { 124 - (void)setIsThemedWindow:(BOOL)isThemedWindow {
118 isThemedWindow_ = isThemedWindow; 125 isThemedWindow_ = isThemedWindow;
119 } 126 }
120 127
121 - (void)setHasError:(BOOL)hasError withTitle:(NSString*)title { 128 - (void)setHasError:(BOOL)hasError withTitle:(NSString*)title {
122 hasError_ = hasError; 129 hasError_ = hasError;
123 int messageId = hasError ? 130 int messageId = hasError ?
124 IDS_PROFILES_ACCOUNT_BUTTON_AUTH_ERROR_ACCESSIBLE_NAME : 131 IDS_PROFILES_ACCOUNT_BUTTON_AUTH_ERROR_ACCESSIBLE_NAME :
125 IDS_PROFILES_NEW_AVATAR_BUTTON_ACCESSIBLE_NAME; 132 IDS_PROFILES_NEW_AVATAR_BUTTON_ACCESSIBLE_NAME;
126 133
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 layoutSubviews]; 290 layoutSubviews];
284 } 291 }
285 } 292 }
286 293
287 - (void)updateErrorStatus:(BOOL)hasError { 294 - (void)updateErrorStatus:(BOOL)hasError {
288 hasError_ = hasError; 295 hasError_ = hasError;
289 [self updateAvatarButtonAndLayoutParent:YES]; 296 [self updateAvatarButtonAndLayoutParent:YES];
290 } 297 }
291 298
292 @end 299 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/new_tab_button.mm ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698