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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 // start a second action... which can crash Chrome. But don't disable if it | 703 // start a second action... which can crash Chrome. But don't disable if it |
704 // has no parent (like in tests) because that will also crash. | 704 // has no parent (like in tests) because that will also crash. |
705 if (sender->parent()) | 705 if (sender->parent()) |
706 sender->SetEnabled(false); | 706 sender->SetEnabled(false); |
707 | 707 |
708 if (sender == users_button_) { | 708 if (sender == users_button_) { |
709 // If this is a guest session, close all the guest browser windows. | 709 // If this is a guest session, close all the guest browser windows. |
710 if (browser_->profile()->IsGuestSession()) | 710 if (browser_->profile()->IsGuestSession()) |
711 profiles::CloseGuestProfileWindows(); | 711 profiles::CloseGuestProfileWindows(); |
712 else | 712 else |
713 chrome::ShowUserManager(browser_->profile()->GetPath()); | 713 chrome::ShowUserManager(base::FilePath()); |
714 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER); | 714 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER); |
715 } else if (sender == go_incognito_button_) { | 715 } else if (sender == go_incognito_button_) { |
716 DCHECK(ShouldShowGoIncognito()); | 716 DCHECK(ShouldShowGoIncognito()); |
717 chrome::NewIncognitoWindow(browser_); | 717 chrome::NewIncognitoWindow(browser_); |
718 } else if (sender == lock_button_) { | 718 } else if (sender == lock_button_) { |
719 profiles::LockProfile(browser_->profile()); | 719 profiles::LockProfile(browser_->profile()); |
720 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); | 720 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); |
721 } else if (sender == auth_error_email_button_) { | 721 } else if (sender == auth_error_email_button_) { |
722 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH, avatar_menu_.get()); | 722 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH, avatar_menu_.get()); |
723 } else if (sender == tutorial_sync_settings_ok_button_) { | 723 } else if (sender == tutorial_sync_settings_ok_button_) { |
(...skipping 27 matching lines...) Expand all Loading... |
751 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : | 751 profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT : |
752 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 752 profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
753 } else if (sender == current_profile_photo_) { | 753 } else if (sender == current_profile_photo_) { |
754 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 754 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
755 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); | 755 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); |
756 } else if (sender == signin_current_profile_link_) { | 756 } else if (sender == signin_current_profile_link_) { |
757 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); | 757 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); |
758 } else if (sender == add_person_button_) { | 758 } else if (sender == add_person_button_) { |
759 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 759 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
760 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); | 760 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_ADD_PERSON); |
761 chrome::ShowUserManager(browser_->profile()->GetPath()); | 761 chrome::ShowUserManager(base::FilePath()); |
762 } else if (sender == disconnect_button_) { | 762 } else if (sender == disconnect_button_) { |
763 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 763 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
764 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_DISCONNECT); | 764 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_DISCONNECT); |
765 chrome::ShowSettings(browser_); | 765 chrome::ShowSettings(browser_); |
766 } else if (sender == switch_user_cancel_button_) { | 766 } else if (sender == switch_user_cancel_button_) { |
767 ShowView(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 767 ShowView(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
768 ProfileMetrics::LogProfileNewAvatarMenuNotYou( | 768 ProfileMetrics::LogProfileNewAvatarMenuNotYou( |
769 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_BACK); | 769 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_BACK); |
770 } else { | 770 } else { |
771 // Either one of the "other profiles", or one of the profile accounts | 771 // Either one of the "other profiles", or one of the profile accounts |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1640 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1641 IncognitoModePrefs::DISABLED; | 1641 IncognitoModePrefs::DISABLED; |
1642 return incognito_available && !browser_->profile()->IsGuestSession(); | 1642 return incognito_available && !browser_->profile()->IsGuestSession(); |
1643 } | 1643 } |
1644 | 1644 |
1645 void ProfileChooserView::PostActionPerformed( | 1645 void ProfileChooserView::PostActionPerformed( |
1646 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1646 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1647 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1647 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1648 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1648 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1649 } | 1649 } |
OLD | NEW |