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

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

Issue 1136693002: Chrome user menu shouldn't close if a tab steals focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Michael's nit comments Created 5 years, 7 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 [[NSNotificationCenter defaultCenter] 211 [[NSNotificationCenter defaultCenter]
212 addObserver:self 212 addObserver:self
213 selector:@selector(bubbleWillClose:) 213 selector:@selector(bubbleWillClose:)
214 name:NSWindowWillCloseNotification 214 name:NSWindowWillCloseNotification
215 object:[menuController_ window]]; 215 object:[menuController_ window]];
216 [menuController_ showWindow:self]; 216 [menuController_ showWindow:self];
217 217
218 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); 218 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
219 } 219 }
220 220
221 - (void)closeAvatarBubble {
222 [menuController_ close];
223 }
224
221 - (IBAction)buttonClicked:(id)sender { 225 - (IBAction)buttonClicked:(id)sender {
222 BrowserWindow::AvatarBubbleMode mode = 226 BrowserWindow::AvatarBubbleMode mode =
223 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT; 227 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT;
224 228
225 [self showAvatarBubbleAnchoredAt:button_ 229 [self showAvatarBubbleAnchoredAt:button_
226 withMode:mode 230 withMode:mode
227 withServiceType:signin::GAIA_SERVICE_TYPE_NONE]; 231 withServiceType:signin::GAIA_SERVICE_TYPE_NONE];
228 } 232 }
229 233
230 - (IBAction)buttonRightClicked:(id)sender { 234 - (IBAction)buttonRightClicked:(id)sender {
(...skipping 20 matching lines...) Expand all
251 } 255 }
252 256
253 - (void)updateErrorStatus:(BOOL)hasError { 257 - (void)updateErrorStatus:(BOOL)hasError {
254 } 258 }
255 259
256 - (BaseBubbleController*)menuController { 260 - (BaseBubbleController*)menuController {
257 return menuController_; 261 return menuController_;
258 } 262 }
259 263
260 @end 264 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698