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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import <Carbon/Carbon.h> // kVK_Return. | 6 #import <Carbon/Carbon.h> // kVK_Return. |
7 | 7 |
8 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 8 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
9 | 9 |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
694 [profileNameTextField_ setTarget:self]; | 694 [profileNameTextField_ setTarget:self]; |
695 [profileNameTextField_ setAction:@selector(saveProfileName:)]; | 695 [profileNameTextField_ setAction:@selector(saveProfileName:)]; |
696 | 696 |
697 // Hide the textfield until the user clicks on the button. | 697 // Hide the textfield until the user clicks on the button. |
698 [profileNameTextField_ setHidden:YES]; | 698 [profileNameTextField_ setHidden:YES]; |
699 | 699 |
700 [[self cell] accessibilitySetOverrideValue:l10n_util::GetNSStringF( | 700 [[self cell] accessibilitySetOverrideValue:l10n_util::GetNSStringF( |
701 IDS_PROFILES_NEW_AVATAR_MENU_EDIT_NAME_ACCESSIBLE_NAME, | 701 IDS_PROFILES_NEW_AVATAR_MENU_EDIT_NAME_ACCESSIBLE_NAME, |
702 base::SysNSStringToUTF16(profileName)) | 702 base::SysNSStringToUTF16(profileName)) |
703 forAttribute:NSAccessibilityTitleAttribute]; | 703 forAttribute:NSAccessibilityTitleAttribute]; |
704 | |
groby-ooo-7-16
2015/02/19 19:00:10
Question: Why not allow expansion tooltips on |pro
| |
705 NSSize textSize = [profileName sizeWithAttributes: | |
706 @{NSFontAttributeName: [NSFont labelFontOfSize:kTitleFontSize]}]; | |
groby-ooo-7-16
2015/02/19 19:00:10
[profileNameTextField_ font] instead, please.
| |
707 | |
708 if (textSize.width > frameRect.size.width - [hoverImage size].width * 2) { | |
groby-ooo-7-16
2015/02/19 19:00:10
... > NSWidth(frameRect)
(We're usually avoiding
| |
709 [self setToolTip:profileName]; | |
710 } | |
704 } | 711 } |
705 | 712 |
706 [[self cell] accessibilitySetOverrideValue:NSAccessibilityButtonRole | 713 [[self cell] accessibilitySetOverrideValue:NSAccessibilityButtonRole |
707 forAttribute:NSAccessibilityRoleAttribute]; | 714 forAttribute:NSAccessibilityRoleAttribute]; |
708 [[self cell] | 715 [[self cell] |
709 accessibilitySetOverrideValue:NSAccessibilityRoleDescription( | 716 accessibilitySetOverrideValue:NSAccessibilityRoleDescription( |
710 NSAccessibilityButtonRole, nil) | 717 NSAccessibilityButtonRole, nil) |
711 forAttribute:NSAccessibilityRoleDescriptionAttribute]; | 718 forAttribute:NSAccessibilityRoleDescriptionAttribute]; |
712 | 719 |
713 [self setBordered:NO]; | 720 [self setBordered:NO]; |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2284 } | 2291 } |
2285 | 2292 |
2286 - (bool)shouldShowGoIncognito { | 2293 - (bool)shouldShowGoIncognito { |
2287 bool incognitoAvailable = | 2294 bool incognitoAvailable = |
2288 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2295 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2289 IncognitoModePrefs::DISABLED; | 2296 IncognitoModePrefs::DISABLED; |
2290 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2297 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2291 } | 2298 } |
2292 | 2299 |
2293 @end | 2300 @end |
OLD | NEW |