| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 ShowView(mode, avatar_menu_.get()); | 854 ShowView(mode, avatar_menu_.get()); |
| 855 } | 855 } |
| 856 } | 856 } |
| 857 | 857 |
| 858 void ProfileChooserView::WindowClosing() { | 858 void ProfileChooserView::WindowClosing() { |
| 859 DCHECK_EQ(profile_bubble_, this); | 859 DCHECK_EQ(profile_bubble_, this); |
| 860 profile_bubble_ = NULL; | 860 profile_bubble_ = NULL; |
| 861 | 861 |
| 862 if (tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { | 862 if (tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { |
| 863 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 863 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
| 864 SyncConfirmationUIClosed(false /* configure_sync_first */); | 864 SyncConfirmationUIClosed(LoginUIService::SYNC_WITH_DEFAULT_SETTINGS); |
| 865 } | 865 } |
| 866 } | 866 } |
| 867 | 867 |
| 868 bool ProfileChooserView::AcceleratorPressed( | 868 bool ProfileChooserView::AcceleratorPressed( |
| 869 const ui::Accelerator& accelerator) { | 869 const ui::Accelerator& accelerator) { |
| 870 if (accelerator.key_code() != ui::VKEY_DOWN && | 870 if (accelerator.key_code() != ui::VKEY_DOWN && |
| 871 accelerator.key_code() != ui::VKEY_UP) | 871 accelerator.key_code() != ui::VKEY_UP) |
| 872 return BubbleDelegateView::AcceleratorPressed(accelerator); | 872 return BubbleDelegateView::AcceleratorPressed(accelerator); |
| 873 // Move the focus up or down. | 873 // Move the focus up or down. |
| 874 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); | 874 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 902 DCHECK(ShouldShowGoIncognito()); | 902 DCHECK(ShouldShowGoIncognito()); |
| 903 chrome::NewIncognitoWindow(browser_); | 903 chrome::NewIncognitoWindow(browser_); |
| 904 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); | 904 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); |
| 905 } else if (sender == lock_button_) { | 905 } else if (sender == lock_button_) { |
| 906 profiles::LockProfile(browser_->profile()); | 906 profiles::LockProfile(browser_->profile()); |
| 907 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); | 907 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); |
| 908 } else if (sender == auth_error_email_button_) { | 908 } else if (sender == auth_error_email_button_) { |
| 909 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); | 909 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); |
| 910 } else if (sender == tutorial_sync_settings_ok_button_) { | 910 } else if (sender == tutorial_sync_settings_ok_button_) { |
| 911 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 911 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
| 912 SyncConfirmationUIClosed(false /* configure_sync_first */); | 912 SyncConfirmationUIClosed(LoginUIService::SYNC_WITH_DEFAULT_SETTINGS); |
| 913 DismissTutorial(); | 913 DismissTutorial(); |
| 914 ProfileMetrics::LogProfileNewAvatarMenuSignin( | 914 ProfileMetrics::LogProfileNewAvatarMenuSignin( |
| 915 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_OK); | 915 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_OK); |
| 916 } else if (sender == tutorial_close_button_) { | 916 } else if (sender == tutorial_close_button_) { |
| 917 DCHECK(tutorial_mode_ != profiles::TUTORIAL_MODE_NONE && | 917 DCHECK(tutorial_mode_ != profiles::TUTORIAL_MODE_NONE && |
| 918 tutorial_mode_ != profiles::TUTORIAL_MODE_CONFIRM_SIGNIN); | 918 tutorial_mode_ != profiles::TUTORIAL_MODE_CONFIRM_SIGNIN); |
| 919 DismissTutorial(); | 919 DismissTutorial(); |
| 920 } else if (sender == tutorial_see_whats_new_button_) { | 920 } else if (sender == tutorial_see_whats_new_button_) { |
| 921 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 921 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
| 922 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); | 922 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 // the account management view is displayed for non signed-in users. | 1003 // the account management view is displayed for non signed-in users. |
| 1004 ShowViewFromMode( | 1004 ShowViewFromMode( |
| 1005 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ? | 1005 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ? |
| 1006 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER : | 1006 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER : |
| 1007 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT); | 1007 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT); |
| 1008 } else if (sender == add_account_link_) { | 1008 } else if (sender == add_account_link_) { |
| 1009 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT); | 1009 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT); |
| 1010 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT); | 1010 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT); |
| 1011 } else if (sender == tutorial_sync_settings_link_) { | 1011 } else if (sender == tutorial_sync_settings_link_) { |
| 1012 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 1012 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
| 1013 SyncConfirmationUIClosed(true /* configure_sync_first */); | 1013 SyncConfirmationUIClosed(LoginUIService::CONFIGURE_SYNC_FIRST); |
| 1014 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; | 1014 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; |
| 1015 ProfileMetrics::LogProfileNewAvatarMenuSignin( | 1015 ProfileMetrics::LogProfileNewAvatarMenuSignin( |
| 1016 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_SETTINGS); | 1016 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_SETTINGS); |
| 1017 } else if (sender == tutorial_not_you_link_) { | 1017 } else if (sender == tutorial_not_you_link_) { |
| 1018 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 1018 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
| 1019 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); | 1019 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); |
| 1020 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_SWITCH_USER); | 1020 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_SWITCH_USER); |
| 1021 } else { | 1021 } else { |
| 1022 DCHECK(sender == tutorial_learn_more_link_); | 1022 DCHECK(sender == tutorial_learn_more_link_); |
| 1023 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); | 1023 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1868 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1869 IncognitoModePrefs::DISABLED; | 1869 IncognitoModePrefs::DISABLED; |
| 1870 return incognito_available && !browser_->profile()->IsGuestSession(); | 1870 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1871 } | 1871 } |
| 1872 | 1872 |
| 1873 void ProfileChooserView::PostActionPerformed( | 1873 void ProfileChooserView::PostActionPerformed( |
| 1874 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1874 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1875 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1875 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1876 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1876 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1877 } | 1877 } |
| OLD | NEW |