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 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1628 withController:self]); | 1628 withController:self]); |
1629 | 1629 |
1630 [container addSubview:iconView]; | 1630 [container addSubview:iconView]; |
1631 yOffset = NSMaxY([iconView frame]); | 1631 yOffset = NSMaxY([iconView frame]); |
1632 | 1632 |
1633 if (browser_->profile()->IsSupervised()) { | 1633 if (browser_->profile()->IsSupervised()) { |
1634 base::scoped_nsobject<NSImageView> supervisedIcon( | 1634 base::scoped_nsobject<NSImageView> supervisedIcon( |
1635 [[NSImageView alloc] initWithFrame:NSZeroRect]); | 1635 [[NSImageView alloc] initWithFrame:NSZeroRect]); |
1636 int imageId = browser_->profile()->IsChild() | 1636 int imageId = browser_->profile()->IsChild() |
1637 ? IDR_ICON_PROFILES_MENU_CHILD | 1637 ? IDR_ICON_PROFILES_MENU_CHILD |
1638 : IDR_ICON_PROFILES_MENU_SUPERVISED; | 1638 : IDR_ICON_PROFILES_MENU_LEGACY_SUPERVISED; |
1639 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 1639 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
1640 [supervisedIcon setImage:rb->GetNativeImageNamed(imageId).ToNSImage()]; | 1640 [supervisedIcon setImage:rb->GetNativeImageNamed(imageId).ToNSImage()]; |
1641 NSSize size = [[supervisedIcon image] size]; | 1641 NSSize size = [[supervisedIcon image] size]; |
1642 [supervisedIcon setFrameSize:size]; | 1642 [supervisedIcon setFrameSize:size]; |
1643 NSRect parentFrame = [iconView frame]; | 1643 NSRect parentFrame = [iconView frame]; |
1644 [supervisedIcon setFrameOrigin:NSMakePoint(NSMaxX(parentFrame) - size.width, | 1644 [supervisedIcon setFrameOrigin:NSMakePoint(NSMaxX(parentFrame) - size.width, |
1645 NSMinY(parentFrame))]; | 1645 NSMinY(parentFrame))]; |
1646 [container addSubview:supervisedIcon]; | 1646 [container addSubview:supervisedIcon]; |
1647 } | 1647 } |
1648 | 1648 |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 } | 2269 } |
2270 | 2270 |
2271 - (bool)shouldShowGoIncognito { | 2271 - (bool)shouldShowGoIncognito { |
2272 bool incognitoAvailable = | 2272 bool incognitoAvailable = |
2273 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2273 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
2274 IncognitoModePrefs::DISABLED; | 2274 IncognitoModePrefs::DISABLED; |
2275 return incognitoAvailable && !browser_->profile()->IsGuestSession(); | 2275 return incognitoAvailable && !browser_->profile()->IsGuestSession(); |
2276 } | 2276 } |
2277 | 2277 |
2278 @end | 2278 @end |
OLD | NEW |