| 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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 ShowView(mode, avatar_menu_.get()); | 859 ShowView(mode, avatar_menu_.get()); |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 | 862 |
| 863 void ProfileChooserView::WindowClosing() { | 863 void ProfileChooserView::WindowClosing() { |
| 864 DCHECK_EQ(profile_bubble_, this); | 864 DCHECK_EQ(profile_bubble_, this); |
| 865 profile_bubble_ = NULL; | 865 profile_bubble_ = NULL; |
| 866 | 866 |
| 867 if (tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { | 867 if (tutorial_mode_ == profiles::TUTORIAL_MODE_CONFIRM_SIGNIN) { |
| 868 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 868 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
| 869 SyncConfirmationUIClosed(false /* configure_sync_first */); | 869 SyncConfirmationUIClosed(LoginUIService::SYNC_WITH_DEFAULT_SETTINGS); |
| 870 } | 870 } |
| 871 } | 871 } |
| 872 | 872 |
| 873 bool ProfileChooserView::AcceleratorPressed( | 873 bool ProfileChooserView::AcceleratorPressed( |
| 874 const ui::Accelerator& accelerator) { | 874 const ui::Accelerator& accelerator) { |
| 875 if (accelerator.key_code() != ui::VKEY_DOWN && | 875 if (accelerator.key_code() != ui::VKEY_DOWN && |
| 876 accelerator.key_code() != ui::VKEY_UP) | 876 accelerator.key_code() != ui::VKEY_UP) |
| 877 return BubbleDelegateView::AcceleratorPressed(accelerator); | 877 return BubbleDelegateView::AcceleratorPressed(accelerator); |
| 878 // Move the focus up or down. | 878 // Move the focus up or down. |
| 879 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); | 879 GetFocusManager()->AdvanceFocus(accelerator.key_code() != ui::VKEY_DOWN); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 907 DCHECK(ShouldShowGoIncognito()); | 907 DCHECK(ShouldShowGoIncognito()); |
| 908 chrome::NewIncognitoWindow(browser_); | 908 chrome::NewIncognitoWindow(browser_); |
| 909 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); | 909 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); |
| 910 } else if (sender == lock_button_) { | 910 } else if (sender == lock_button_) { |
| 911 profiles::LockProfile(browser_->profile()); | 911 profiles::LockProfile(browser_->profile()); |
| 912 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); | 912 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); |
| 913 } else if (sender == auth_error_email_button_) { | 913 } else if (sender == auth_error_email_button_) { |
| 914 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); | 914 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); |
| 915 } else if (sender == tutorial_sync_settings_ok_button_) { | 915 } else if (sender == tutorial_sync_settings_ok_button_) { |
| 916 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 916 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
| 917 SyncConfirmationUIClosed(false /* configure_sync_first */); | 917 SyncConfirmationUIClosed(LoginUIService::SYNC_WITH_DEFAULT_SETTINGS); |
| 918 DismissTutorial(); | 918 DismissTutorial(); |
| 919 ProfileMetrics::LogProfileNewAvatarMenuSignin( | 919 ProfileMetrics::LogProfileNewAvatarMenuSignin( |
| 920 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_OK); | 920 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_OK); |
| 921 } else if (sender == tutorial_close_button_) { | 921 } else if (sender == tutorial_close_button_) { |
| 922 DCHECK(tutorial_mode_ != profiles::TUTORIAL_MODE_NONE && | 922 DCHECK(tutorial_mode_ != profiles::TUTORIAL_MODE_NONE && |
| 923 tutorial_mode_ != profiles::TUTORIAL_MODE_CONFIRM_SIGNIN); | 923 tutorial_mode_ != profiles::TUTORIAL_MODE_CONFIRM_SIGNIN); |
| 924 DismissTutorial(); | 924 DismissTutorial(); |
| 925 } else if (sender == tutorial_see_whats_new_button_) { | 925 } else if (sender == tutorial_see_whats_new_button_) { |
| 926 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 926 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
| 927 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); | 927 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 // the account management view is displayed for non signed-in users. | 1008 // the account management view is displayed for non signed-in users. |
| 1009 ShowViewFromMode( | 1009 ShowViewFromMode( |
| 1010 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ? | 1010 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT ? |
| 1011 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER : | 1011 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER : |
| 1012 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT); | 1012 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT); |
| 1013 } else if (sender == add_account_link_) { | 1013 } else if (sender == add_account_link_) { |
| 1014 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT); | 1014 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT); |
| 1015 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT); | 1015 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_ADD_ACCT); |
| 1016 } else if (sender == tutorial_sync_settings_link_) { | 1016 } else if (sender == tutorial_sync_settings_link_) { |
| 1017 LoginUIServiceFactory::GetForProfile(browser_->profile())-> | 1017 LoginUIServiceFactory::GetForProfile(browser_->profile())-> |
| 1018 SyncConfirmationUIClosed(true /* configure_sync_first */); | 1018 SyncConfirmationUIClosed(LoginUIService::CONFIGURE_SYNC_FIRST); |
| 1019 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; | 1019 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; |
| 1020 ProfileMetrics::LogProfileNewAvatarMenuSignin( | 1020 ProfileMetrics::LogProfileNewAvatarMenuSignin( |
| 1021 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_SETTINGS); | 1021 ProfileMetrics::PROFILE_AVATAR_MENU_SIGNIN_SETTINGS); |
| 1022 } else if (sender == tutorial_not_you_link_) { | 1022 } else if (sender == tutorial_not_you_link_) { |
| 1023 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 1023 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
| 1024 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); | 1024 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); |
| 1025 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_SWITCH_USER); | 1025 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_SWITCH_USER); |
| 1026 } else { | 1026 } else { |
| 1027 DCHECK(sender == tutorial_learn_more_link_); | 1027 DCHECK(sender == tutorial_learn_more_link_); |
| 1028 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); | 1028 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1873 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1874 IncognitoModePrefs::DISABLED; | 1874 IncognitoModePrefs::DISABLED; |
| 1875 return incognito_available && !browser_->profile()->IsGuestSession(); | 1875 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1876 } | 1876 } |
| 1877 | 1877 |
| 1878 void ProfileChooserView::PostActionPerformed( | 1878 void ProfileChooserView::PostActionPerformed( |
| 1879 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1879 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1880 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1880 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1881 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1881 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1882 } | 1882 } |
| OLD | NEW |