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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 737 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
738 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); | 738 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_WHATS_NEW); |
739 chrome::ShowUserManagerWithTutorial( | 739 chrome::ShowUserManagerWithTutorial( |
740 profiles::USER_MANAGER_TUTORIAL_OVERVIEW); | 740 profiles::USER_MANAGER_TUTORIAL_OVERVIEW); |
741 } else if (sender == remove_account_button_) { | 741 } else if (sender == remove_account_button_) { |
742 RemoveAccount(); | 742 RemoveAccount(); |
743 } else if (sender == account_removal_cancel_button_) { | 743 } else if (sender == account_removal_cancel_button_) { |
744 account_id_to_remove_.clear(); | 744 account_id_to_remove_.clear(); |
745 ShowView(profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get()); | 745 ShowView(profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get()); |
746 } else if (sender == gaia_signin_cancel_button_) { | 746 } else if (sender == gaia_signin_cancel_button_) { |
747 std::string primary_account = | |
748 SigninManagerFactory::GetForProfile(browser_->profile())-> | |
749 GetAuthenticatedAccountId(); | |
750 // The account management view is only available with the | 747 // The account management view is only available with the |
751 // --enable-account-consistency flag. | 748 // --enable-account-consistency flag. |
752 bool account_management_available = !primary_account.empty() && | 749 bool account_management_available = |
| 750 SigninManagerFactory::GetForProfile(browser_->profile())-> |
| 751 IsAuthenticated() && |
753 switches::IsEnableAccountConsistency(); | 752 switches::IsEnableAccountConsistency(); |
754 ShowView(account_management_available ? | 753 ShowView(account_management_available ? |
755 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : | 754 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : |
756 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 755 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
757 } else if (sender == current_profile_photo_) { | 756 } else if (sender == current_profile_photo_) { |
758 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 757 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
759 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); | 758 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); |
760 } else if (sender == signin_current_profile_link_) { | 759 } else if (sender == signin_current_profile_link_) { |
761 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); | 760 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); |
762 } else if (sender == add_person_button_) { | 761 } else if (sender == add_person_button_) { |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1643 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1645 IncognitoModePrefs::DISABLED; | 1644 IncognitoModePrefs::DISABLED; |
1646 return incognito_available && !browser_->profile()->IsGuestSession(); | 1645 return incognito_available && !browser_->profile()->IsGuestSession(); |
1647 } | 1646 } |
1648 | 1647 |
1649 void ProfileChooserView::PostActionPerformed( | 1648 void ProfileChooserView::PostActionPerformed( |
1650 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1649 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1651 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1650 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1652 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1651 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1653 } | 1652 } |
OLD | NEW |