OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_CHROMEOS_PROFILES_PROFILE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROFILES_PROFILE_HELPER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PROFILES_PROFILE_HELPER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROFILES_PROFILE_HELPER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 15 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
16 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" | 16 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
17 #include "components/user_manager/user_manager.h" | 17 #include "components/user_manager/user_manager.h" |
18 | 18 |
19 class Profile; | 19 class Profile; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class FilePath; | 22 class FilePath; |
23 } | 23 } |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 class ExtensionGarbageCollectorChromeOSUnitTest; | 26 class ExtensionGarbageCollectorChromeOSUnitTest; |
27 } | 27 } |
28 | 28 |
| 29 namespace ash { |
| 30 namespace test { |
| 31 class MultiUserWindowManagerChromeOSTest; |
| 32 } // namespace test |
| 33 } // namespace ash |
| 34 |
29 namespace chromeos { | 35 namespace chromeos { |
30 | 36 |
31 // This helper class is used on Chrome OS to keep track of currently | 37 // This helper class is used on Chrome OS to keep track of currently |
32 // active user profile. | 38 // active user profile. |
33 // Whenever active user is changed (either add another user into session or | 39 // Whenever active user is changed (either add another user into session or |
34 // switch between users), ActiveUserHashChanged() will be called thus | 40 // switch between users), ActiveUserHashChanged() will be called thus |
35 // internal state |active_user_id_hash_| will be updated. | 41 // internal state |active_user_id_hash_| will be updated. |
36 // Typical use cases for using this class: | 42 // Typical use cases for using this class: |
37 // 1. Get "signin profile" which is a special type of profile that is only used | 43 // 1. Get "signin profile" which is a special type of profile that is only used |
38 // during signin flow: GetSigninProfile() | 44 // during signin flow: GetSigninProfile() |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 friend class extensions::ExtensionGarbageCollectorChromeOSUnitTest; | 138 friend class extensions::ExtensionGarbageCollectorChromeOSUnitTest; |
133 friend class FakeChromeUserManager; | 139 friend class FakeChromeUserManager; |
134 friend class KioskTest; | 140 friend class KioskTest; |
135 friend class MockUserManager; | 141 friend class MockUserManager; |
136 friend class MultiProfileUserControllerTest; | 142 friend class MultiProfileUserControllerTest; |
137 friend class PrinterServiceProviderAppSearchEnabledTest; | 143 friend class PrinterServiceProviderAppSearchEnabledTest; |
138 friend class ProfileHelperTest; | 144 friend class ProfileHelperTest; |
139 friend class ProfileListChromeOSTest; | 145 friend class ProfileListChromeOSTest; |
140 friend class SessionStateDelegateChromeOSTest; | 146 friend class SessionStateDelegateChromeOSTest; |
141 friend class SystemTrayDelegateChromeOSTest; | 147 friend class SystemTrayDelegateChromeOSTest; |
| 148 friend class ash::test::MultiUserWindowManagerChromeOSTest; |
142 | 149 |
143 // Called when signin profile is cleared. | 150 // Called when signin profile is cleared. |
144 void OnSigninProfileCleared(); | 151 void OnSigninProfileCleared(); |
145 | 152 |
146 // BrowsingDataRemover::Observer implementation: | 153 // BrowsingDataRemover::Observer implementation: |
147 void OnBrowsingDataRemoverDone() override; | 154 void OnBrowsingDataRemoverDone() override; |
148 | 155 |
149 // OAuth2LoginManager::Observer overrides. | 156 // OAuth2LoginManager::Observer overrides. |
150 void OnSessionRestoreStateChanged( | 157 void OnSessionRestoreStateChanged( |
151 Profile* user_profile, | 158 Profile* user_profile, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 static bool always_return_primary_user_for_testing; | 207 static bool always_return_primary_user_for_testing; |
201 | 208 |
202 base::WeakPtrFactory<ProfileHelper> weak_factory_; | 209 base::WeakPtrFactory<ProfileHelper> weak_factory_; |
203 | 210 |
204 DISALLOW_COPY_AND_ASSIGN(ProfileHelper); | 211 DISALLOW_COPY_AND_ASSIGN(ProfileHelper); |
205 }; | 212 }; |
206 | 213 |
207 } // namespace chromeos | 214 } // namespace chromeos |
208 | 215 |
209 #endif // CHROME_BROWSER_CHROMEOS_PROFILES_PROFILE_HELPER_H_ | 216 #endif // CHROME_BROWSER_CHROMEOS_PROFILES_PROFILE_HELPER_H_ |
OLD | NEW |