OLD | NEW |
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 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 ShowView(mode, avatar_menu_.get()); | 848 ShowView(mode, avatar_menu_.get()); |
849 } | 849 } |
850 } | 850 } |
851 | 851 |
852 void ProfileChooserView::WindowClosing() { | 852 void ProfileChooserView::WindowClosing() { |
853 DCHECK_EQ(profile_bubble_, this); | 853 DCHECK_EQ(profile_bubble_, this); |
854 profile_bubble_ = NULL; | 854 profile_bubble_ = NULL; |
855 | 855 |
856 if (tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { | 856 if (tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { |
857 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 857 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
858 SyncConfirmationUIClosed(false /* configure_sync_first */); | 858 SyncConfirmationUIClosed(LoginUIService::SYNC_WITH_DEFAULT_SETTINGS); |
859 } | 859 } |
860 } | 860 } |
861 | 861 |
862 bool ProfileChooserView::AcceleratorPressed( | 862 bool ProfileChooserView::AcceleratorPressed( |
863 const ui::Accelerator& accelerator) { | 863 const ui::Accelerator& accelerator) { |
864 if (accelerator.key_code() != ui::VKEY_DOWN && | 864 if (accelerator.key_code() != ui::VKEY_DOWN && |
865 accelerator.key_code() != ui::VKEY_UP) | 865 accelerator.key_code() != ui::VKEY_UP) |
866 return BubbleDelegateView::AcceleratorPressed(accelerator); | 866 return BubbleDelegateView::AcceleratorPressed(accelerator); |
867 // Move the focus up or down. | 867 // Move the focus up or down. |
868 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); | 868 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); |
(...skipping 27 matching lines...) Expand all Loading... |
896 DCHECK(ShouldShowGoIncognito()); | 896 DCHECK(ShouldShowGoIncognito()); |
897 chrome::NewIncognitoWindow(browser_); | 897 chrome::NewIncognitoWindow(browser_); |
898 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); | 898 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); |
899 } else if (sender == lock_button_) { | 899 } else if (sender == lock_button_) { |
900 profiles::LockProfile(browser_->profile()); | 900 profiles::LockProfile(browser_->profile()); |
901 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); | 901 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); |
902 } else if (sender == auth_error_email_button_) { | 902 } else if (sender == auth_error_email_button_) { |
903 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); | 903 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); |
904 } else if (sender == tutorial_sync_settings_ok_button_) { | 904 } else if (sender == tutorial_sync_settings_ok_button_) { |
905 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 905 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
906 SyncConfirmationUIClosed(false /* configure_sync_first */); | 906 SyncConfirmationUIClosed(LoginUIService::SYNC_WITH_DEFAULT_SETTINGS); |
907 DismissTutorial(); | 907 DismissTutorial(); |
908 ProfileMetrics::LogProfileNewAvatarMenuSignin( | 908 ProfileMetrics::LogProfileNewAvatarMenuSignin( |
909 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_OK); | 909 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_OK); |
910 } else if (sender == tutorial_close_button_) { | 910 } else if (sender == tutorial_close_button_) { |
911 DCHECK(tutorial_mode_ != profiles::TUTORIAL_MODE_NONE && | 911 DCHECK(tutorial_mode_ != profiles::TUTORIAL_MODE_NONE && |
912 tutorial_mode_ != profiles::TUTORIAL_MODE_CONFIRM_SIGNIN); | 912 tutorial_mode_ != profiles::TUTORIAL_MODE_CONFIRM_SIGNIN); |
913 DismissTutorial(); | 913 DismissTutorial(); |
914 } else if (sender == tutorial_see_whats_new_button_) { | 914 } else if (sender == tutorial_see_whats_new_button_) { |
915 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 915 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
916 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); | 916 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 // the account management view is displayed for non signed-in users. | 997 // the account management view is displayed for non signed-in users. |
998 ShowViewFromMode( | 998 ShowViewFromMode( |
999 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ? | 999 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ? |
1000 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER : | 1000 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER : |
1001 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT); | 1001 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT); |
1002 } else if (sender == add_account_link_) { | 1002 } else if (sender == add_account_link_) { |
1003 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT); | 1003 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT); |
1004 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT); | 1004 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT); |
1005 } else if (sender == tutorial_sync_settings_link_) { | 1005 } else if (sender == tutorial_sync_settings_link_) { |
1006 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 1006 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
1007 SyncConfirmationUIClosed(true /* configure_sync_first */); | 1007 SyncConfirmationUIClosed(LoginUIService::CONFIGURE_SYNC_FIRST); |
1008 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; | 1008 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; |
1009 ProfileMetrics::LogProfileNewAvatarMenuSignin( | 1009 ProfileMetrics::LogProfileNewAvatarMenuSignin( |
1010 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_SETTINGS); | 1010 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_SETTINGS); |
1011 } else if (sender == tutorial_not_you_link_) { | 1011 } else if (sender == tutorial_not_you_link_) { |
1012 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 1012 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
1013 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); | 1013 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); |
1014 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_SWITCH_USER); | 1014 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_SWITCH_USER); |
1015 } else { | 1015 } else { |
1016 DCHECK(sender == tutorial_learn_more_link_); | 1016 DCHECK(sender == tutorial_learn_more_link_); |
1017 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); | 1017 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1862 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1863 IncognitoModePrefs::DISABLED; | 1863 IncognitoModePrefs::DISABLED; |
1864 return incognito_available && !browser_->profile()->IsGuestSession(); | 1864 return incognito_available && !browser_->profile()->IsGuestSession(); |
1865 } | 1865 } |
1866 | 1866 |
1867 void ProfileChooserView::PostActionPerformed( | 1867 void ProfileChooserView::PostActionPerformed( |
1868 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1868 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1869 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1869 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1870 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1870 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1871 } | 1871 } |
OLD | NEW |