Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 2239443003: [MD User Menu] Removed the tooltips for profile buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698