| 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 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/ui/chrome_pages.h" | 27 #include "chrome/browser/ui/chrome_pages.h" |
| 28 #include "chrome/browser/ui/singleton_tabs.h" | 28 #include "chrome/browser/ui/singleton_tabs.h" |
| 29 #include "chrome/browser/ui/user_manager.h" | 29 #include "chrome/browser/ui/user_manager.h" |
| 30 #include "chrome/browser/ui/views/profiles/user_manager_view.h" | 30 #include "chrome/browser/ui/views/profiles/user_manager_view.h" |
| 31 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 31 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 32 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 32 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 35 #include "chrome/grit/chromium_strings.h" | 35 #include "chrome/grit/chromium_strings.h" |
| 36 #include "chrome/grit/generated_resources.h" | 36 #include "chrome/grit/generated_resources.h" |
| 37 #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h" | |
| 38 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 37 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 39 #include "components/signin/core/browser/signin_error_controller.h" | 38 #include "components/signin/core/browser/signin_error_controller.h" |
| 40 #include "components/signin/core/browser/signin_manager.h" | 39 #include "components/signin/core/browser/signin_manager.h" |
| 41 #include "components/signin/core/common/profile_management_switches.h" | 40 #include "components/signin/core/common/profile_management_switches.h" |
| 42 #include "content/public/browser/render_widget_host_view.h" | 41 #include "content/public/browser/render_widget_host_view.h" |
| 43 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
| 44 #include "third_party/skia/include/core/SkColor.h" | 43 #include "third_party/skia/include/core/SkColor.h" |
| 45 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 45 #include "ui/base/resource/resource_bundle.h" |
| 47 #include "ui/compositor/clip_transform_recorder.h" | 46 #include "ui/compositor/clip_transform_recorder.h" |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 account_match = reauth_account_button_map_.find(sender); | 812 account_match = reauth_account_button_map_.find(sender); |
| 814 DCHECK(account_match != reauth_account_button_map_.end()); | 813 DCHECK(account_match != reauth_account_button_map_.end()); |
| 815 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH, avatar_menu_.get()); | 814 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH, avatar_menu_.get()); |
| 816 } | 815 } |
| 817 } | 816 } |
| 818 } | 817 } |
| 819 } | 818 } |
| 820 | 819 |
| 821 void ProfileChooserView::RemoveAccount() { | 820 void ProfileChooserView::RemoveAccount() { |
| 822 DCHECK(!account_id_to_remove_.empty()); | 821 DCHECK(!account_id_to_remove_.empty()); |
| 823 MutableProfileOAuth2TokenService* oauth2_token_service = | 822 ProfileOAuth2TokenService* oauth2_token_service = |
| 824 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 823 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); |
| 825 browser_->profile()); | |
| 826 if (oauth2_token_service) { | 824 if (oauth2_token_service) { |
| 827 oauth2_token_service->RevokeCredentials(account_id_to_remove_); | 825 oauth2_token_service->RevokeCredentials(account_id_to_remove_); |
| 828 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT); | 826 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_REMOVE_ACCT); |
| 829 } | 827 } |
| 830 account_id_to_remove_.clear(); | 828 account_id_to_remove_.clear(); |
| 831 | 829 |
| 832 ShowView(profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get()); | 830 ShowView(profiles::BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, avatar_menu_.get()); |
| 833 } | 831 } |
| 834 | 832 |
| 835 void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) { | 833 void ProfileChooserView::LinkClicked(views::Link* sender, int event_flags) { |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1702 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1705 IncognitoModePrefs::DISABLED; | 1703 IncognitoModePrefs::DISABLED; |
| 1706 return incognito_available && !browser_->profile()->IsGuestSession(); | 1704 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1707 } | 1705 } |
| 1708 | 1706 |
| 1709 void ProfileChooserView::PostActionPerformed( | 1707 void ProfileChooserView::PostActionPerformed( |
| 1710 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1708 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1711 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1709 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1712 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1710 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1713 } | 1711 } |
| OLD | NEW |