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

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

Issue 2316853002: [Material][Mac] Action on Mouse Down for User Account Button (Closed)
Patch Set: Revert dialog pixel adjustment Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_button_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_attributes_entry.h" 10 #include "chrome/browser/profiles/profile_attributes_entry.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 [avatarButton setButtonType:NSMomentaryChangeButton]; 217 [avatarButton setButtonType:NSMomentaryChangeButton];
218 if (switches::IsMaterialDesignUserMenu()) 218 if (switches::IsMaterialDesignUserMenu())
219 [[avatarButton cell] setHighlightsBy:NSNoCellMask]; 219 [[avatarButton cell] setHighlightsBy:NSNoCellMask];
220 [avatarButton setBordered:YES]; 220 [avatarButton setBordered:YES];
221 221
222 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin]; 222 [avatarButton setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin];
223 [avatarButton setTarget:self]; 223 [avatarButton setTarget:self];
224 [avatarButton setAction:@selector(buttonClicked:)]; 224 [avatarButton setAction:@selector(buttonClicked:)];
225 [avatarButton setRightAction:@selector(buttonRightClicked:)]; 225 [avatarButton setRightAction:@selector(buttonRightClicked:)];
226 226
227 if (ui::MaterialDesignController::IsModeMaterial())
228 [avatarButton sendActionOn:NSLeftMouseDownMask];
229
227 // Check if the account already has an authentication or sync error and 230 // Check if the account already has an authentication or sync error and
228 // initialize the avatar button UI. 231 // initialize the avatar button UI.
229 hasError_ = profileObserver_->HasAvatarError(); 232 hasError_ = profileObserver_->HasAvatarError();
230 [self updateAvatarButtonAndLayoutParent:NO]; 233 [self updateAvatarButtonAndLayoutParent:NO];
231 234
232 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 235 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
233 [center addObserver:self 236 [center addObserver:self
234 selector:@selector(themeDidChangeNotification:) 237 selector:@selector(themeDidChangeNotification:)
235 name:kBrowserThemeDidChangeNotification 238 name:kBrowserThemeDidChangeNotification
236 object:nil]; 239 object:nil];
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 layoutSubviews]; 360 layoutSubviews];
358 } 361 }
359 } 362 }
360 363
361 - (void)setErrorStatus:(BOOL)hasError { 364 - (void)setErrorStatus:(BOOL)hasError {
362 hasError_ = hasError; 365 hasError_ = hasError;
363 [self updateAvatarButtonAndLayoutParent:YES]; 366 [self updateAvatarButtonAndLayoutParent:YES];
364 } 367 }
365 368
366 @end 369 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698