| 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/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/lifetime/application_lifetime.h" | 11 #include "chrome/browser/lifetime/application_lifetime.h" |
| 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 12 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 13 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 13 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 14 #include "chrome/browser/profiles/profile_info_cache.h" | |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/browser/profiles/profile_metrics.h" | 15 #include "chrome/browser/profiles/profile_metrics.h" |
| 17 #include "chrome/browser/profiles/profile_window.h" | 16 #include "chrome/browser/profiles/profile_window.h" |
| 18 #include "chrome/browser/profiles/profiles_state.h" | 17 #include "chrome/browser/profiles/profiles_state.h" |
| 19 #include "chrome/browser/signin/chrome_signin_helper.h" | 18 #include "chrome/browser/signin/chrome_signin_helper.h" |
| 20 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 19 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 21 #include "chrome/browser/signin/signin_error_controller_factory.h" | 20 #include "chrome/browser/signin/signin_error_controller_factory.h" |
| 22 #include "chrome/browser/signin/signin_manager_factory.h" | 21 #include "chrome/browser/signin/signin_manager_factory.h" |
| 23 #include "chrome/browser/signin/signin_promo.h" | 22 #include "chrome/browser/signin/signin_promo.h" |
| 24 #include "chrome/browser/signin/signin_ui_util.h" | 23 #include "chrome/browser/signin/signin_ui_util.h" |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 view_mode_(view_mode), | 663 view_mode_(view_mode), |
| 665 tutorial_mode_(tutorial_mode), | 664 tutorial_mode_(tutorial_mode), |
| 666 gaia_service_type_(service_type), | 665 gaia_service_type_(service_type), |
| 667 access_point_(access_point) { | 666 access_point_(access_point) { |
| 668 // Reset the default margins inherited from the BubbleDelegateView. | 667 // Reset the default margins inherited from the BubbleDelegateView. |
| 669 // Add a small bottom inset so that the bubble's rounded corners show up. | 668 // Add a small bottom inset so that the bubble's rounded corners show up. |
| 670 set_margins(gfx::Insets(0, 0, 1, 0)); | 669 set_margins(gfx::Insets(0, 0, 1, 0)); |
| 671 ResetView(); | 670 ResetView(); |
| 672 | 671 |
| 673 avatar_menu_.reset(new AvatarMenu( | 672 avatar_menu_.reset(new AvatarMenu( |
| 674 &g_browser_process->profile_manager()->GetProfileInfoCache(), | 673 &g_browser_process->profile_manager()->GetProfileAttributesStorage(), |
| 675 this, | 674 this, |
| 676 browser_)); | 675 browser_)); |
| 677 avatar_menu_->RebuildMenu(); | 676 avatar_menu_->RebuildMenu(); |
| 678 | 677 |
| 679 ProfileOAuth2TokenService* oauth2_token_service = | 678 ProfileOAuth2TokenService* oauth2_token_service = |
| 680 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); | 679 ProfileOAuth2TokenServiceFactory::GetForProfile(browser_->profile()); |
| 681 if (oauth2_token_service) | 680 if (oauth2_token_service) |
| 682 oauth2_token_service->AddObserver(this); | 681 oauth2_token_service->AddObserver(this); |
| 683 } | 682 } |
| 684 | 683 |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1867 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1869 IncognitoModePrefs::DISABLED; | 1868 IncognitoModePrefs::DISABLED; |
| 1870 return incognito_available && !browser_->profile()->IsGuestSession(); | 1869 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1871 } | 1870 } |
| 1872 | 1871 |
| 1873 void ProfileChooserView::PostActionPerformed( | 1872 void ProfileChooserView::PostActionPerformed( |
| 1874 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1873 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1875 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1874 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1876 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1875 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1877 } | 1876 } |
| OLD | NEW |