| 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 23 matching lines...) Expand all Loading... |
| 34 if ((self = [super initWithBrowser:browser])) { | 34 if ((self = [super initWithBrowser:browser])) { |
| 35 browser_ = browser; | 35 browser_ = browser; |
| 36 | 36 |
| 37 base::scoped_nsobject<NSView> container( | 37 base::scoped_nsobject<NSView> container( |
| 38 [[NSView alloc] initWithFrame:NSMakeRect( | 38 [[NSView alloc] initWithFrame:NSMakeRect( |
| 39 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); | 39 0, 0, profiles::kAvatarIconWidth, profiles::kAvatarIconHeight)]); |
| 40 [container setWantsLayer:YES]; | 40 [container setWantsLayer:YES]; |
| 41 [self setView:container]; | 41 [self setView:container]; |
| 42 | 42 |
| 43 bool isModeMaterial = ui::MaterialDesignController::IsModeMaterial(); | 43 bool isModeMaterial = ui::MaterialDesignController::IsModeMaterial(); |
| 44 NSRect frameRect = NSMakeRect(4, 5, profiles::kAvatarIconWidth, | 44 NSRect frameRect = NSMakeRect(5, 5, profiles::kAvatarIconWidth, |
| 45 profiles::kAvatarIconHeight); | 45 profiles::kAvatarIconHeight); |
| 46 if (!isModeMaterial) { | 46 if (!isModeMaterial) { |
| 47 frameRect.origin = NSZeroPoint; | 47 frameRect.origin = NSZeroPoint; |
| 48 } | 48 } |
| 49 button_.reset([[NSButton alloc] initWithFrame:frameRect]); | 49 button_.reset([[NSButton alloc] initWithFrame:frameRect]); |
| 50 NSButtonCell* cell = [button_ cell]; | 50 NSButtonCell* cell = [button_ cell]; |
| 51 [button_ setButtonType:NSMomentaryLightButton]; | 51 [button_ setButtonType:NSMomentaryLightButton]; |
| 52 | 52 |
| 53 [button_ setImagePosition:NSImageOnly]; | 53 [button_ setImagePosition:NSImageOnly]; |
| 54 [cell setImageScaling:NSImageScaleProportionallyDown]; | 54 [cell setImageScaling:NSImageScaleProportionallyDown]; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 hints:nil]; | 123 hints:nil]; |
| 124 | 124 |
| 125 [destination unlockFocus]; | 125 [destination unlockFocus]; |
| 126 | 126 |
| 127 return destination.autorelease(); | 127 return destination.autorelease(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent {} | 130 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent {} |
| 131 | 131 |
| 132 @end | 132 @end |
| OLD | NEW |