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 5d35fcd96461d9af1500346ad53b616763c9d06d..9238e0cad88c90a05116d477542c5cf90cf9f10d 100644 |
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc |
@@ -15,6 +15,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" |
@@ -386,6 +387,7 @@ bool ProfileChooserView::close_on_deactivate_for_testing_ = true; |
// static |
void ProfileChooserView::ShowBubble( |
BubbleViewMode view_mode, |
+ signin::GAIA_SERVICE_TYPE service_type, |
views::View* anchor_view, |
views::BubbleBorder::Arrow arrow, |
views::BubbleBorder::BubbleAlignment border_alignment, |
@@ -395,7 +397,7 @@ void ProfileChooserView::ShowBubble( |
return; |
profile_bubble_ = new ProfileChooserView(anchor_view, arrow, anchor_rect, |
- browser, view_mode); |
+ browser, view_mode, service_type); |
views::BubbleDelegateView::CreateBubble(profile_bubble_); |
profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); |
profile_bubble_->SetAlignment(border_alignment); |
@@ -418,11 +420,13 @@ ProfileChooserView::ProfileChooserView(views::View* anchor_view, |
views::BubbleBorder::Arrow arrow, |
const gfx::Rect& anchor_rect, |
Browser* browser, |
- BubbleViewMode view_mode) |
+ BubbleViewMode view_mode, |
+ signin::GAIA_SERVICE_TYPE service_type) |
: BubbleDelegateView(anchor_view, arrow), |
browser_(browser), |
+ tutorial_mode_(TUTORIAL_MODE_NONE), |
view_mode_(view_mode), |
- tutorial_mode_(TUTORIAL_MODE_NONE) { |
+ gaia_service_type_(service_type) { |
guohui
2014/05/22 20:20:49
gaia_service_type_ is not cleared anywhere, it mea
Mike Lerman
2014/05/23 17:15:36
There is not real default, we would need to reset
|
// Reset the default margins inherited from the BubbleDelegateView. |
set_margins(gfx::Insets()); |
@@ -568,6 +572,8 @@ void ProfileChooserView::ButtonPressed(views::Button* sender, |
if (browser_->profile()->IsGuestSession()) |
profiles::CloseGuestProfileWindows(); |
} else if (sender == lock_button_) { |
+ ProfileMetrics::LogProfileDesktopMenu( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK, gaia_service_type_); |
profiles::LockProfile(browser_->profile()); |
} else if (sender == tutorial_ok_button_) { |
// If the user manually dismissed the tutorial, never show it again by |
@@ -630,6 +636,8 @@ void ProfileChooserView::ButtonPressed(views::Button* sender, |
ProfileMetrics::SWITCH_PROFILE_ICON); |
} else { |
// This was a profile accounts button. |
+ ProfileMetrics::LogProfileDesktopMenu( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT, gaia_service_type_); |
guohui
2014/05/22 20:20:49
here we just show the account removal view, the ac
Mike Lerman
2014/05/23 17:15:36
Done.
|
AccountButtonIndexes::const_iterator account_match = |
current_profile_accounts_map_.find(sender); |
DCHECK(account_match != current_profile_accounts_map_.end()); |
@@ -662,6 +670,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::LogProfileDesktopMenu( |
+ ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT, gaia_service_type_); |
ShowView(BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, avatar_menu_.get()); |
} else if (sender == tutorial_learn_more_link_) { |
ProfileMetrics::LogProfileUpgradeEnrollment( |