OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profiles/profiles_state.h" | 5 #include "chrome/browser/profiles/profiles_state.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/profiles/gaia_info_update_service.h" |
| 13 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
12 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/profiles/profile_info_cache.h" | 15 #include "chrome/browser/profiles/profile_info_cache.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
16 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/common/chrome_constants.h" | 19 #include "chrome/common/chrome_constants.h" |
18 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
19 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 21 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 22 #include "components/signin/core/common/profile_management_switches.h" |
20 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
21 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
22 | 25 |
23 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
24 #include "chrome/browser/chromeos/login/user_manager.h" | 27 #include "chrome/browser/chromeos/login/user_manager.h" |
25 #endif | 28 #endif |
26 | 29 |
27 namespace profiles { | 30 namespace profiles { |
28 | 31 |
29 bool IsMultipleProfilesEnabled() { | 32 bool IsMultipleProfilesEnabled() { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 accounts.erase(primary_index); | 109 accounts.erase(primary_index); |
107 | 110 |
108 return accounts; | 111 return accounts; |
109 } | 112 } |
110 | 113 |
111 bool IsRegularOrGuestSession(Browser* browser) { | 114 bool IsRegularOrGuestSession(Browser* browser) { |
112 Profile* profile = browser->profile(); | 115 Profile* profile = browser->profile(); |
113 return profile->IsGuestSession() || !profile->IsOffTheRecord(); | 116 return profile->IsGuestSession() || !profile->IsOffTheRecord(); |
114 } | 117 } |
115 | 118 |
| 119 void UpdateGAIAProfilePhotoIfNeeded(Profile* profile) { |
| 120 // If the --google-profile-info flag isn't used, then the |
| 121 // GAIAInfoUpdateService isn't initialized, and we can't download the picture. |
| 122 if (!switches::IsGoogleProfileInfo()) |
| 123 return; |
| 124 |
| 125 DCHECK(profile); |
| 126 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); |
| 127 } |
| 128 |
116 } // namespace profiles | 129 } // namespace profiles |
OLD | NEW |