| 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_menu_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
| 8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 NSRect frame = [nameField frame]; | 160 NSRect frame = [nameField frame]; |
| 161 frame.size.width = kMaxItemTextWidth; | 161 frame.size.width = kMaxItemTextWidth; |
| 162 [nameField setFrame:frame]; | 162 [nameField setFrame:frame]; |
| 163 if ([nameField respondsToSelector:@selector(setAllowsExpansionToolTips:)]) | 163 if ([nameField respondsToSelector:@selector(setAllowsExpansionToolTips:)]) |
| 164 [nameField setAllowsExpansionToolTips:YES]; | 164 [nameField setAllowsExpansionToolTips:YES]; |
| 165 } | 165 } |
| 166 *widthAdjust = std::max(*widthAdjust, delta.width); | 166 *widthAdjust = std::max(*widthAdjust, delta.width); |
| 167 | 167 |
| 168 // Repeat for the sync state/email. | 168 // Repeat for the sync state/email. |
| 169 NSTextField* emailField = itemView.emailField; | 169 NSTextField* emailField = itemView.emailField; |
| 170 emailField.stringValue = base::SysUTF16ToNSString(item.sync_state); | 170 emailField.stringValue = base::SysUTF16ToNSString(item.username); |
| 171 delta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:emailField]; | 171 delta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:emailField]; |
| 172 if (NSWidth([emailField frame]) > kMaxItemTextWidth) { | 172 if (NSWidth([emailField frame]) > kMaxItemTextWidth) { |
| 173 delta.width -= (NSWidth([emailField frame]) - kMaxItemTextWidth); | 173 delta.width -= (NSWidth([emailField frame]) - kMaxItemTextWidth); |
| 174 NSRect frame = [emailField frame]; | 174 NSRect frame = [emailField frame]; |
| 175 frame.size.width = kMaxItemTextWidth; | 175 frame.size.width = kMaxItemTextWidth; |
| 176 [emailField setFrame:frame]; | 176 [emailField setFrame:frame]; |
| 177 } | 177 } |
| 178 *widthAdjust = std::max(*widthAdjust, delta.width); | 178 *widthAdjust = std::max(*widthAdjust, delta.width); |
| 179 | 179 |
| 180 if (!item.active) { | 180 if (!item.active) { |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 - (BOOL)accessibilityIsIgnored { | 713 - (BOOL)accessibilityIsIgnored { |
| 714 return YES; | 714 return YES; |
| 715 } | 715 } |
| 716 @end | 716 @end |
| 717 | 717 |
| 718 @implementation AccessibilityIgnoredTextFieldCell | 718 @implementation AccessibilityIgnoredTextFieldCell |
| 719 - (BOOL)accessibilityIsIgnored { | 719 - (BOOL)accessibilityIsIgnored { |
| 720 return YES; | 720 return YES; |
| 721 } | 721 } |
| 722 @end | 722 @end |
| OLD | NEW |