| 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/avatar_icon_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 if ((self = [super initWithBrowser:browser])) { | 37 if ((self = [super initWithBrowser:browser])) { |
| 38 browser_ = browser; | 38 browser_ = browser; |
| 39 | 39 |
| 40 base::scoped_nsobject<NSView> container( | 40 base::scoped_nsobject<NSView> container( |
| 41 [[NSView alloc] initWithFrame:NSMakeRect( | 41 [[NSView alloc] initWithFrame:NSMakeRect( |
| 42 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); | 42 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); |
| 43 [container setWantsLayer:YES]; | 43 [container setWantsLayer:YES]; |
| 44 [self setView:container]; | 44 [self setView:container]; |
| 45 | 45 |
| 46 bool isModeMaterial = ui::MaterialDesignController::IsModeMaterial(); | 46 bool isModeMaterial = ui::MaterialDesignController::IsModeMaterial(); |
| 47 NSRect frameRect = NSMakeRect(4, 5, profiles::kAvatarIconWidth, | 47 NSRect frameRect = NSMakeRect(5, 5, profiles::kAvatarIconWidth, |
| 48 profiles::kAvatarIconHeight); | 48 profiles::kAvatarIconHeight); |
| 49 if (!isModeMaterial) { | 49 if (!isModeMaterial) { |
| 50 frameRect.origin = NSZeroPoint; | 50 frameRect.origin = NSZeroPoint; |
| 51 } | 51 } |
| 52 button_.reset([[NSButton alloc] initWithFrame:frameRect]); | 52 button_.reset([[NSButton alloc] initWithFrame:frameRect]); |
| 53 NSButtonCell* cell = [button_ cell]; | 53 NSButtonCell* cell = [button_ cell]; |
| 54 [button_ setButtonType:NSMomentaryLightButton]; | 54 [button_ setButtonType:NSMomentaryLightButton]; |
| 55 | 55 |
| 56 [button_ setImagePosition:NSImageOnly]; | 56 [button_ setImagePosition:NSImageOnly]; |
| 57 [cell setImageScaling:NSImageScaleProportionallyDown]; | 57 [cell setImageScaling:NSImageScaleProportionallyDown]; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 hints:nil]; | 126 hints:nil]; |
| 127 | 127 |
| 128 [destination unlockFocus]; | 128 [destination unlockFocus]; |
| 129 | 129 |
| 130 return destination.autorelease(); | 130 return destination.autorelease(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent {} | 133 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent {} |
| 134 | 134 |
| 135 @end | 135 @end |
| OLD | NEW |