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

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

Issue 1680773006: Implement Material Design for Mac toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md_master
Patch Set: Change button hover and pressed styles. Created 4 years, 9 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/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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/cocoa/themed_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698