| 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/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 delete_account_button_map_.clear(); | 574 delete_account_button_map_.clear(); |
| 575 reauth_account_button_map_.clear(); | 575 reauth_account_button_map_.clear(); |
| 576 sync_error_signin_button_ = nullptr; | 576 sync_error_signin_button_ = nullptr; |
| 577 sync_error_passphrase_button_ = nullptr; | 577 sync_error_passphrase_button_ = nullptr; |
| 578 sync_error_upgrade_button_ = nullptr; | 578 sync_error_upgrade_button_ = nullptr; |
| 579 sync_error_signin_again_button_ = nullptr; | 579 sync_error_signin_again_button_ = nullptr; |
| 580 sync_error_signout_button_ = nullptr; | 580 sync_error_signout_button_ = nullptr; |
| 581 manage_accounts_link_ = nullptr; | 581 manage_accounts_link_ = nullptr; |
| 582 manage_accounts_button_ = nullptr; | 582 manage_accounts_button_ = nullptr; |
| 583 signin_current_profile_button_ = nullptr; | 583 signin_current_profile_button_ = nullptr; |
| 584 auth_error_email_button_ = nullptr; | |
| 585 current_profile_card_ = nullptr; | 584 current_profile_card_ = nullptr; |
| 586 first_profile_button_ = nullptr; | 585 first_profile_button_ = nullptr; |
| 587 guest_profile_button_ = nullptr; | 586 guest_profile_button_ = nullptr; |
| 588 users_button_ = nullptr; | 587 users_button_ = nullptr; |
| 589 go_incognito_button_ = nullptr; | 588 go_incognito_button_ = nullptr; |
| 590 lock_button_ = nullptr; | 589 lock_button_ = nullptr; |
| 591 close_all_windows_button_ = nullptr; | 590 close_all_windows_button_ = nullptr; |
| 592 add_account_link_ = nullptr; | 591 add_account_link_ = nullptr; |
| 593 gaia_signin_cancel_button_ = nullptr; | 592 gaia_signin_cancel_button_ = nullptr; |
| 594 remove_account_button_ = nullptr; | 593 remove_account_button_ = nullptr; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 625 AddAccelerator(ui::Accelerator(ui::VKEY_UP, ui::EF_NONE)); | 624 AddAccelerator(ui::Accelerator(ui::VKEY_UP, ui::EF_NONE)); |
| 626 | 625 |
| 627 ShowViewFromMode(view_mode_); | 626 ShowViewFromMode(view_mode_); |
| 628 } | 627 } |
| 629 | 628 |
| 630 void ProfileChooserView::OnNativeThemeChanged( | 629 void ProfileChooserView::OnNativeThemeChanged( |
| 631 const ui::NativeTheme* native_theme) { | 630 const ui::NativeTheme* native_theme) { |
| 632 views::BubbleDialogDelegateView::OnNativeThemeChanged(native_theme); | 631 views::BubbleDialogDelegateView::OnNativeThemeChanged(native_theme); |
| 633 SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( | 632 SetBackground(views::CreateSolidBackground(GetNativeTheme()->GetSystemColor( |
| 634 ui::NativeTheme::kColorId_DialogBackground))); | 633 ui::NativeTheme::kColorId_DialogBackground))); |
| 635 if (auth_error_email_button_) { | |
| 636 auth_error_email_button_->SetTextColor( | |
| 637 views::LabelButton::STATE_NORMAL, | |
| 638 native_theme->GetSystemColor(ui::NativeTheme::kColorId_LinkEnabled)); | |
| 639 } | |
| 640 } | 634 } |
| 641 | 635 |
| 642 void ProfileChooserView::OnAvatarMenuChanged( | 636 void ProfileChooserView::OnAvatarMenuChanged( |
| 643 AvatarMenu* avatar_menu) { | 637 AvatarMenu* avatar_menu) { |
| 644 if (IsProfileChooser(view_mode_) || | 638 if (IsProfileChooser(view_mode_) || |
| 645 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT) { | 639 view_mode_ == profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT) { |
| 646 // Refresh the view with the new menu. We can't just update the local copy | 640 // Refresh the view with the new menu. We can't just update the local copy |
| 647 // as this may have been triggered by a sign out action, in which case | 641 // as this may have been triggered by a sign out action, in which case |
| 648 // the view is being destroyed. | 642 // the view is being destroyed. |
| 649 ShowView(view_mode_, avatar_menu); | 643 ShowView(view_mode_, avatar_menu); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER); | 795 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_OPEN_USER_MANAGER); |
| 802 } else if (sender == go_incognito_button_) { | 796 } else if (sender == go_incognito_button_) { |
| 803 DCHECK(ShouldShowGoIncognito()); | 797 DCHECK(ShouldShowGoIncognito()); |
| 804 chrome::NewIncognitoWindow(browser_); | 798 chrome::NewIncognitoWindow(browser_); |
| 805 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); | 799 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_GO_INCOGNITO); |
| 806 } else if (sender == lock_button_) { | 800 } else if (sender == lock_button_) { |
| 807 profiles::LockProfile(browser_->profile()); | 801 profiles::LockProfile(browser_->profile()); |
| 808 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); | 802 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_LOCK); |
| 809 } else if (sender == close_all_windows_button_) { | 803 } else if (sender == close_all_windows_button_) { |
| 810 profiles::CloseProfileWindows(browser_->profile()); | 804 profiles::CloseProfileWindows(browser_->profile()); |
| 811 } else if (sender == auth_error_email_button_ || | 805 } else if (sender == sync_error_signin_button_) { |
| 812 sender == sync_error_signin_button_) { | |
| 813 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); | 806 ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH); |
| 814 } else if (sender == sync_error_passphrase_button_) { | 807 } else if (sender == sync_error_passphrase_button_) { |
| 815 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); | 808 chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); |
| 816 } else if (sender == sync_error_upgrade_button_) { | 809 } else if (sender == sync_error_upgrade_button_) { |
| 817 chrome::OpenUpdateChromeDialog(browser_); | 810 chrome::OpenUpdateChromeDialog(browser_); |
| 818 } else if (sender == sync_error_signin_again_button_) { | 811 } else if (sender == sync_error_signin_again_button_) { |
| 819 if (ProfileSyncServiceFactory::GetForProfile(browser_->profile())) | 812 if (ProfileSyncServiceFactory::GetForProfile(browser_->profile())) |
| 820 browser_sync::ProfileSyncService::SyncEvent( | 813 browser_sync::ProfileSyncService::SyncEvent( |
| 821 browser_sync::ProfileSyncService::STOP_FROM_OPTIONS); | 814 browser_sync::ProfileSyncService::STOP_FROM_OPTIONS); |
| 822 SigninManagerFactory::GetForProfile(browser_->profile()) | 815 SigninManagerFactory::GetForProfile(browser_->profile()) |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1617 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1625 IncognitoModePrefs::DISABLED; | 1618 IncognitoModePrefs::DISABLED; |
| 1626 return incognito_available && !browser_->profile()->IsGuestSession(); | 1619 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1627 } | 1620 } |
| 1628 | 1621 |
| 1629 void ProfileChooserView::PostActionPerformed( | 1622 void ProfileChooserView::PostActionPerformed( |
| 1630 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1623 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1631 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1624 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1632 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1625 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1633 } | 1626 } |
| OLD | NEW |