| 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/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/avatar_menu.h" | 10 #include "chrome/browser/profiles/avatar_menu.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // Adjust the name field to fit the string. If it overflows, record by how | 152 // Adjust the name field to fit the string. If it overflows, record by how |
| 153 // much the window needs to grow to accomodate the new size of the field. | 153 // much the window needs to grow to accomodate the new size of the field. |
| 154 NSTextField* nameField = itemView.nameField; | 154 NSTextField* nameField = itemView.nameField; |
| 155 nameField.stringValue = base::SysUTF16ToNSString(item.name); | 155 nameField.stringValue = base::SysUTF16ToNSString(item.name); |
| 156 NSSize delta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:nameField]; | 156 NSSize delta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:nameField]; |
| 157 if (NSWidth([nameField frame]) > kMaxItemTextWidth) { | 157 if (NSWidth([nameField frame]) > kMaxItemTextWidth) { |
| 158 delta.width -= (NSWidth([nameField frame]) - kMaxItemTextWidth); | 158 delta.width -= (NSWidth([nameField frame]) - kMaxItemTextWidth); |
| 159 NSRect frame = [nameField frame]; | 159 NSRect frame = [nameField frame]; |
| 160 frame.size.width = kMaxItemTextWidth; | 160 frame.size.width = kMaxItemTextWidth; |
| 161 [nameField setFrame:frame]; | 161 [nameField setFrame:frame]; |
| 162 if ([nameField respondsToSelector:@selector(setAllowsExpansionToolTips:)]) { |
| 163 [nameField setAllowsExpansionToolTips:YES]; |
| 164 } |
| 162 } | 165 } |
| 163 *widthAdjust = std::max(*widthAdjust, delta.width); | 166 *widthAdjust = std::max(*widthAdjust, delta.width); |
| 164 | 167 |
| 165 // Repeat for the sync state/email. | 168 // Repeat for the sync state/email. |
| 166 NSTextField* emailField = itemView.emailField; | 169 NSTextField* emailField = itemView.emailField; |
| 167 emailField.stringValue = base::SysUTF16ToNSString(item.sync_state); | 170 emailField.stringValue = base::SysUTF16ToNSString(item.sync_state); |
| 168 delta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:emailField]; | 171 delta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:emailField]; |
| 169 if (NSWidth([emailField frame]) > kMaxItemTextWidth) { | 172 if (NSWidth([emailField frame]) > kMaxItemTextWidth) { |
| 170 delta.width -= (NSWidth([emailField frame]) - kMaxItemTextWidth); | 173 delta.width -= (NSWidth([emailField frame]) - kMaxItemTextWidth); |
| 171 NSRect frame = [emailField frame]; | 174 NSRect frame = [emailField frame]; |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 - (BOOL)accessibilityIsIgnored { | 713 - (BOOL)accessibilityIsIgnored { |
| 711 return YES; | 714 return YES; |
| 712 } | 715 } |
| 713 @end | 716 @end |
| 714 | 717 |
| 715 @implementation AccessibilityIgnoredTextFieldCell | 718 @implementation AccessibilityIgnoredTextFieldCell |
| 716 - (BOOL)accessibilityIsIgnored { | 719 - (BOOL)accessibilityIsIgnored { |
| 717 return YES; | 720 return YES; |
| 718 } | 721 } |
| 719 @end | 722 @end |
| OLD | NEW |