| 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/profile_chooser_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
| 6 | 6 |
| 7 #import <Carbon/Carbon.h> // kVK_Return. | 7 #import <Carbon/Carbon.h> // kVK_Return. |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 [profileButton setAlignment:NSLeftTextAlignment]; | 2325 [profileButton setAlignment:NSLeftTextAlignment]; |
| 2326 [profileButton setBordered:NO]; | 2326 [profileButton setBordered:NO]; |
| 2327 [profileButton setTag:itemIndex]; | 2327 [profileButton setTag:itemIndex]; |
| 2328 [profileButton setTarget:self]; | 2328 [profileButton setTarget:self]; |
| 2329 [profileButton setAction:@selector(switchToProfile:)]; | 2329 [profileButton setAction:@selector(switchToProfile:)]; |
| 2330 | 2330 |
| 2331 NSSize textSize = [[profileButton title] sizeWithAttributes:@{ | 2331 NSSize textSize = [[profileButton title] sizeWithAttributes:@{ |
| 2332 NSFontAttributeName : [profileButton font] | 2332 NSFontAttributeName : [profileButton font] |
| 2333 }]; | 2333 }]; |
| 2334 | 2334 |
| 2335 if (std::ceil(textSize.width) > availableWidth) | 2335 if (!switches::IsMaterialDesignUserMenu() && |
| 2336 std::ceil(textSize.width) > availableWidth) |
| 2336 [profileButton setToolTip:[profileButton title]]; | 2337 [profileButton setToolTip:[profileButton title]]; |
| 2337 | 2338 |
| 2338 return profileButton.autorelease(); | 2339 return profileButton.autorelease(); |
| 2339 } | 2340 } |
| 2340 | 2341 |
| 2341 - (NSView*)createOptionsViewWithRect:(NSRect)rect | 2342 - (NSView*)createOptionsViewWithRect:(NSRect)rect |
| 2342 showLock:(BOOL)showLock { | 2343 showLock:(BOOL)showLock { |
| 2343 NSRect viewRect = NSMakeRect(0, 0, | 2344 NSRect viewRect = NSMakeRect(0, 0, |
| 2344 rect.size.width, | 2345 rect.size.width, |
| 2345 kBlueButtonHeight + kSmallVerticalSpacing); | 2346 kBlueButtonHeight + kSmallVerticalSpacing); |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2893 } | 2894 } |
| 2894 | 2895 |
| 2895 - (bool)shouldShowGoIncognito { | 2896 - (bool)shouldShowGoIncognito { |
| 2896 bool incognitoAvailable = | 2897 bool incognitoAvailable = |
| 2897 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2898 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 2898 IncognitoModePrefs::DISABLED; | 2899 IncognitoModePrefs::DISABLED; |
| 2899 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2900 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
| 2900 } | 2901 } |
| 2901 | 2902 |
| 2902 @end | 2903 @end |
| OLD | NEW |