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 | 6 |
7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" | 7 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" |
8 | 8 |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1245 [[EditableProfilePhoto alloc] | 1245 [[EditableProfilePhoto alloc] |
1246 initWithFrame:NSMakeRect(xOffset, yOffset, | 1246 initWithFrame:NSMakeRect(xOffset, yOffset, |
1247 kLargeImageSide, kLargeImageSide) | 1247 kLargeImageSide, kLargeImageSide) |
1248 avatarMenu:avatarMenu_.get() | 1248 avatarMenu:avatarMenu_.get() |
1249 profileIcon:item.icon | 1249 profileIcon:item.icon |
1250 editingAllowed:!isGuestSession_]); | 1250 editingAllowed:!isGuestSession_]); |
1251 | 1251 |
1252 [container addSubview:iconView]; | 1252 [container addSubview:iconView]; |
1253 yOffset = NSMaxY([iconView frame]); | 1253 yOffset = NSMaxY([iconView frame]); |
1254 | 1254 |
1255 if (browser_->profile()->IsManaged()) { | |
1256 base::scoped_nsobject<NSImageView> supervisedIcon( | |
msw
2014/06/02 21:18:15
nit: it'd be nice to have consistent terminology (
Marc Treib
2014/06/03 08:26:02
Very true. The correct term would be "supervised"
| |
1257 [[NSImageView alloc] initWithFrame:NSZeroRect]); | |
1258 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | |
1259 [supervisedIcon setImage:rb->GetNativeImageNamed( | |
1260 IDR_ICON_PROFILES_MENU_SUPERVISED).ToNSImage()]; | |
1261 NSSize size = [[supervisedIcon image] size]; | |
1262 [supervisedIcon setFrameSize:size]; | |
1263 NSRect parentFrame = [iconView frame]; | |
1264 [supervisedIcon setFrameOrigin:NSMakePoint(NSMaxX(parentFrame) - size.width, | |
1265 NSMinY(parentFrame))]; | |
1266 [container addSubview:supervisedIcon]; | |
1267 } | |
1268 | |
1255 if (switches::IsNewProfileManagementPreviewEnabled()) { | 1269 if (switches::IsNewProfileManagementPreviewEnabled()) { |
1256 base::scoped_nsobject<HoverImageButton> questionButton( | 1270 base::scoped_nsobject<HoverImageButton> questionButton( |
1257 [[HoverImageButton alloc] initWithFrame:NSZeroRect]); | 1271 [[HoverImageButton alloc] initWithFrame:NSZeroRect]); |
1258 [questionButton setBordered:NO]; | 1272 [questionButton setBordered:NO]; |
1259 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 1273 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
1260 [questionButton setDefaultImage:rb->GetNativeImageNamed( | 1274 [questionButton setDefaultImage:rb->GetNativeImageNamed( |
1261 IDR_ICON_PROFILES_MENU_QUESTION_STABLE).ToNSImage()]; | 1275 IDR_ICON_PROFILES_MENU_QUESTION_STABLE).ToNSImage()]; |
1262 [questionButton setHoverImage:rb->GetNativeImageNamed( | 1276 [questionButton setHoverImage:rb->GetNativeImageNamed( |
1263 IDR_ICON_PROFILES_MENU_QUESTION_HOVER).ToNSImage()]; | 1277 IDR_ICON_PROFILES_MENU_QUESTION_HOVER).ToNSImage()]; |
1264 [questionButton setPressedImage:rb->GetNativeImageNamed( | 1278 [questionButton setPressedImage:rb->GetNativeImageNamed( |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1753 IDR_CLOSE_1_P).ToNSImage()]; | 1767 IDR_CLOSE_1_P).ToNSImage()]; |
1754 [deleteButton setTarget:self]; | 1768 [deleteButton setTarget:self]; |
1755 [deleteButton setAction:@selector(showAccountRemovalView:)]; | 1769 [deleteButton setAction:@selector(showAccountRemovalView:)]; |
1756 [deleteButton setTag:tag]; | 1770 [deleteButton setTag:tag]; |
1757 | 1771 |
1758 [button addSubview:deleteButton]; | 1772 [button addSubview:deleteButton]; |
1759 return button.autorelease(); | 1773 return button.autorelease(); |
1760 } | 1774 } |
1761 | 1775 |
1762 @end | 1776 @end |
OLD | NEW |