OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |