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

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 roger's 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 if (menuController_ != nil)
groby-ooo-7-16 2015/05/15 16:16:24 nit: No need to check - you can send messages to n
gogerald1 2015/05/19 23:35:12 Done.
223 [menuController_ close];
224 }
225
221 - (IBAction)buttonClicked:(id)sender { 226 - (IBAction)buttonClicked:(id)sender {
222 BrowserWindow::AvatarBubbleMode mode = 227 BrowserWindow::AvatarBubbleMode mode =
223 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT; 228 BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT;
224 229
225 [self showAvatarBubbleAnchoredAt:button_ 230 [self showAvatarBubbleAnchoredAt:button_
226 withMode:mode 231 withMode:mode
227 withServiceType:signin::GAIA_SERVICE_TYPE_NONE]; 232 withServiceType:signin::GAIA_SERVICE_TYPE_NONE];
228 } 233 }
229 234
230 - (IBAction)buttonRightClicked:(id)sender { 235 - (IBAction)buttonRightClicked:(id)sender {
(...skipping 20 matching lines...) Expand all
251 } 256 }
252 257
253 - (void)updateErrorStatus:(BOOL)hasError { 258 - (void)updateErrorStatus:(BOOL)hasError {
254 } 259 }
255 260
256 - (BaseBubbleController*)menuController { 261 - (BaseBubbleController*)menuController {
257 return menuController_; 262 return menuController_;
258 } 263 }
259 264
260 @end 265 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698