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_base_controller.mm

Issue 869793004: Bring up the Fast User Switcher on Shift+Click on the new Avatar Button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to right click and port to Mac UI Created 5 years, 10 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_base_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_info_cache_observer.h" 10 #include "chrome/browser/profiles/profile_info_cache_observer.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 addObserver:self 203 addObserver:self
204 selector:@selector(bubbleWillClose:) 204 selector:@selector(bubbleWillClose:)
205 name:NSWindowWillCloseNotification 205 name:NSWindowWillCloseNotification
206 object:[menuController_ window]]; 206 object:[menuController_ window]];
207 [menuController_ showWindow:self]; 207 [menuController_ showWindow:self];
208 208
209 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); 209 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
210 } 210 }
211 211
212 - (IBAction)buttonClicked:(id)sender { 212 - (IBAction)buttonClicked:(id)sender {
213 BrowserWindow::AvatarBubbleMode mode =
214 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT;
Roger Tawa OOO till Jul 10th 2015/01/29 23:00:35 Two spaces.
anthonyvd 2015/01/30 15:02:20 Done.
215
216 if([NSEvent modifierFlags] & NSCommandKeyMask) {
217 mode = BrowserWindow::AVATAR_BUBBLE_MODE_FAST_USER_SWITCH;
218 }
Roger Tawa OOO till Jul 10th 2015/01/29 23:00:35 No need for { and }
anthonyvd 2015/01/30 15:02:20 Done.
219
213 [self showAvatarBubbleAnchoredAt:button_ 220 [self showAvatarBubbleAnchoredAt:button_
214 withMode:BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT 221 withMode:mode
215 withServiceType:signin::GAIA_SERVICE_TYPE_NONE]; 222 withServiceType:signin::GAIA_SERVICE_TYPE_NONE];
216 } 223 }
217 224
218 - (void)bubbleWillClose:(NSNotification*)notif { 225 - (void)bubbleWillClose:(NSNotification*)notif {
219 NSWindowController* wc = 226 NSWindowController* wc =
220 [browser_->window()->GetNativeWindow() windowController]; 227 [browser_->window()->GetNativeWindow() windowController];
221 if ([wc isKindOfClass:[BrowserWindowController class]]) { 228 if ([wc isKindOfClass:[BrowserWindowController class]]) {
222 [static_cast<BrowserWindowController*>(wc) 229 [static_cast<BrowserWindowController*>(wc)
223 releaseBarVisibilityForOwner:self withAnimation:YES delay:NO]; 230 releaseBarVisibilityForOwner:self withAnimation:YES delay:NO];
224 } 231 }
225 menuController_ = nil; 232 menuController_ = nil;
226 } 233 }
227 234
228 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent { 235 - (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent {
229 NOTREACHED(); 236 NOTREACHED();
230 } 237 }
231 238
232 - (void)updateErrorStatus:(BOOL)hasError { 239 - (void)updateErrorStatus:(BOOL)hasError {
233 } 240 }
234 241
235 - (BaseBubbleController*)menuController { 242 - (BaseBubbleController*)menuController {
236 return menuController_; 243 return menuController_;
237 } 244 }
238 245
239 @end 246 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698