Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
index 7ff7d0d19c86435755222c9dbc1325ac92a6d478..ed7a29110a3c5709af2ca0e6fa974ced940d3a5f 100644 |
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
@@ -22,6 +22,7 @@ |
#include "chrome/browser/profiles/profile_window.h" |
#include "chrome/browser/profiles/profiles_state.h" |
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
+#include "chrome/browser/signin/signin_header_helper.h" |
#include "chrome/browser/signin/signin_manager_factory.h" |
#include "chrome/browser/signin/signin_promo.h" |
#include "chrome/browser/ui/browser.h" |
@@ -430,6 +431,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
- (void)editPhoto:(id)sender { |
avatarMenu_->EditProfile(avatarMenu_->GetActiveProfileIndex()); |
+ [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE]; |
} |
- (void)mouseEntered:(NSEvent*)event { |
@@ -533,6 +535,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
// Empty profile names are not allowed, and are treated as a cancel. |
if ([text length] > 0) { |
profiles::UpdateProfileName(profile_, base::SysNSStringToUTF16(text)); |
+ [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_NAME]; |
[self setTitle:text]; |
} |
[profileNameTextField_ setHidden:YES]; |
@@ -738,6 +741,9 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
title:(const std::string&)title |
tag:(int)tag; |
+// Clean-up done after an action was performed in the ProfileChooser. |
+- (void)postActionPerformed:(ProfileMetrics::ProfileDesktopMenu)action; |
Scott Hess - ex-Googler
2014/05/30 04:09:27
I think it's weird to have this down here though i
Mike Lerman
2014/05/30 17:46:25
Done... I guess... since there's nothing for me to
|
+ |
@end |
@implementation ProfileChooserController |
@@ -773,6 +779,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
- (IBAction)lockProfile:(id)sender { |
profiles::LockProfile(browser_->profile()); |
+ [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK]; |
} |
- (IBAction)showInlineSigninPage:(id)sender { |
@@ -785,6 +792,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
- (IBAction)addAccount:(id)sender { |
[self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT]; |
+ [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT]; |
} |
- (IBAction)navigateBackFromSigninPage:(id)sender { |
@@ -816,6 +824,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
DCHECK(!accountIdToRemove_.empty()); |
ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
browser_->profile())->RevokeCredentials(accountIdToRemove_); |
+ [self postActionPerformed:ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT]; |
accountIdToRemove_.clear(); |
[self initMenuContentsWithView:profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT]; |
@@ -875,7 +884,8 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
- (id)initWithBrowser:(Browser*)browser |
anchoredAt:(NSPoint)point |
- withMode:(profiles::BubbleViewMode)mode { |
+ withMode:(profiles::BubbleViewMode)mode |
+ withServiceType:(signin::GAIAServiceType)GAIAServiceType { |
base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] |
initWithContentRect:ui::kWindowSizeDeterminedLater |
styleMask:NSBorderlessWindowMask |
@@ -889,6 +899,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
viewMode_ = mode; |
tutorialMode_ = profiles::TUTORIAL_MODE_NONE; |
observer_.reset(new ActiveProfileObserverBridge(self, browser_)); |
+ GAIAServiceType_ = GAIAServiceType; |
avatarMenu_.reset(new AvatarMenu( |
&g_browser_process->profile_manager()->GetProfileInfoCache(), |
@@ -1719,4 +1730,9 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
return button.autorelease(); |
} |
+- (void)postActionPerformed:(ProfileMetrics::ProfileDesktopMenu)action { |
+ ProfileMetrics::LogProfileDesktopMenu(action, GAIAServiceType_); |
+ GAIAServiceType_ = signin::GAIA_SERVICE_TYPE_NONE; |
+} |
+ |
@end |