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

Unified Diff: chrome/browser/ui/cocoa/browser/avatar_base_controller.mm

Issue 216523005: show avatar bubble in edit mode on mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser/avatar_base_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_base_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_base_controller.mm
index 85fa8b4faf5569fe713ffb3e3d1a8254d0c6890b..9d8b6eff77f3c85b113386e316c92eeea60d1f1c 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_base_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_base_controller.mm
@@ -97,7 +97,8 @@ class ProfileInfoUpdateObserver : public ProfileInfoCacheObserver {
return button_.get();
}
-- (void)showAvatarBubble:(NSView*)anchor {
+- (void)showAvatarBubble:(NSView*)anchor
+ mode:(BrowserWindow::AvatarBubbleMode)mode {
if (menuController_)
return;
@@ -117,9 +118,14 @@ class ProfileInfoUpdateObserver : public ProfileInfoCacheObserver {
// |menuController_| will automatically release itself on close.
if (switches::IsNewProfileManagement()) {
+ BubbleViewMode viewMode =
+ mode == BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT ?
+ PROFILE_CHOOSER_VIEW :
+ ACCOUNT_MANAGEMENT_VIEW;
menuController_ =
- [[ProfileChooserController alloc] initWithBrowser:browser_
- anchoredAt:point];
+ [[ProfileChooserController alloc] initWithBrowser:browser_
+ anchoredAt:point
+ viewMode:viewMode];
Alexei Svitkine (slow) 2014/03/28 14:07:31 Nit: withMode:
guohui 2014/03/28 15:28:00 Done.
} else {
menuController_ =
[[AvatarMenuBubbleController alloc] initWithBrowser:browser_
@@ -138,7 +144,8 @@ class ProfileInfoUpdateObserver : public ProfileInfoCacheObserver {
- (IBAction)buttonClicked:(id)sender {
DCHECK_EQ(sender, button_.get());
- [self showAvatarBubble:button_];
+ [self showAvatarBubble:button_
+ mode:BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT];
}
- (void)bubbleWillClose:(NSNotification*)notif {

Powered by Google App Engine
This is Rietveld 408576698