Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc |
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
index 66a55719ec94ddaab18f3f6e8c1ae232c26d8318..1c30b3e6db5be7e94b66bfa6556d3a854780a8a1 100644 |
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
@@ -418,8 +418,11 @@ ProfileChooserView::ProfileChooserView(views::View* anchor_view, |
BubbleViewMode view_mode) |
: BubbleDelegateView(anchor_view, arrow), |
browser_(browser), |
- view_mode_(view_mode), |
- tutorial_mode_(TUTORIAL_MODE_NONE) { |
+ tutorial_mode_(TUTORIAL_MODE_NONE), |
+ view_mode_(view_mode == BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT_FROM_HEADER ? |
+ BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : view_mode), |
+ opened_from_header_( |
+ view_mode == BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT_FROM_HEADER) { |
// Reset the default margins inherited from the BubbleDelegateView. |
set_margins(gfx::Insets()); |
@@ -565,6 +568,8 @@ void ProfileChooserView::ButtonPressed(views::Button* sender, |
if (browser_->profile()->IsGuestSession()) |
profiles::CloseGuestProfileWindows(); |
} else if (sender == lock_button_) { |
+ ProfileMetrics::LogProfileDesktopSignout( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK, opened_from_header_); |
profiles::LockProfile(browser_->profile()); |
} else if (sender == tutorial_ok_button_) { |
// If the user manually dismissed the tutorial, never show it again by |
@@ -619,12 +624,17 @@ void ProfileChooserView::ButtonPressed(views::Button* sender, |
ButtonIndexes::const_iterator profile_match = |
open_other_profile_indexes_map_.find(sender); |
if (profile_match != open_other_profile_indexes_map_.end()) { |
+ ProfileMetrics::LogProfileDesktopSignout( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_SWITCH, opened_from_header_); |
avatar_menu_->SwitchToProfile( |
profile_match->second, |
ui::DispositionFromEventFlags(event.flags()) == NEW_WINDOW, |
ProfileMetrics::SWITCH_PROFILE_ICON); |
} else { |
// This was a profile accounts button. |
+ ProfileMetrics::LogProfileDesktopSignout( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT, |
+ opened_from_header_); |
AccountButtonIndexes::const_iterator account_match = |
current_profile_accounts_map_.find(sender); |
DCHECK(account_match != current_profile_accounts_map_.end()); |
@@ -657,6 +667,8 @@ void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) { |
BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, |
avatar_menu_.get()); |
} else if (sender == add_account_link_) { |
+ ProfileMetrics::LogProfileDesktopSignout( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT, opened_from_header_); |
ShowView(BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, avatar_menu_.get()); |
} else if (sender == tutorial_learn_more_link_) { |
ProfileMetrics::LogProfileUpgradeEnrollment( |