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