OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LOGIN_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/chromeos/base/locale_util.h" | 10 #include "chrome/browser/chromeos/base/locale_util.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Called when UserManager finishes restoring user sessions after crash. | 52 // Called when UserManager finishes restoring user sessions after crash. |
53 virtual void PendingUserSessionsRestoreFinished(); | 53 virtual void PendingUserSessionsRestoreFinished(); |
54 | 54 |
55 protected: | 55 protected: |
56 virtual ~UserSessionStateObserver(); | 56 virtual ~UserSessionStateObserver(); |
57 }; | 57 }; |
58 | 58 |
59 // Data retrieved from user account. | 59 // Data retrieved from user account. |
60 class UserAccountData { | 60 class UserAccountData { |
61 public: | 61 public: |
62 UserAccountData(const string16& display_name, | 62 UserAccountData(const base::string16& display_name, |
63 const string16& given_name, | 63 const base::string16& given_name, |
64 const std::string& locale); | 64 const std::string& locale); |
65 ~UserAccountData(); | 65 ~UserAccountData(); |
66 const string16& display_name() const { return display_name_; } | 66 const base::string16& display_name() const { return display_name_; } |
67 const string16& given_name() const { return given_name_; } | 67 const base::string16& given_name() const { return given_name_; } |
68 const std::string& locale() const { return locale_; } | 68 const std::string& locale() const { return locale_; } |
69 | 69 |
70 private: | 70 private: |
71 const string16 display_name_; | 71 const base::string16 display_name_; |
72 const string16 given_name_; | 72 const base::string16 given_name_; |
73 const std::string locale_; | 73 const std::string locale_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(UserAccountData); | 75 DISALLOW_COPY_AND_ASSIGN(UserAccountData); |
76 }; | 76 }; |
77 | 77 |
78 // Username for stub login when not running on ChromeOS. | 78 // Username for stub login when not running on ChromeOS. |
79 static const char kStubUser[]; | 79 static const char kStubUser[]; |
80 | 80 |
81 // Magic e-mail addresses are bad. They exist here because some code already | 81 // Magic e-mail addresses are bad. They exist here because some code already |
82 // depends on them and it is hard to figure out what. Any user types added in | 82 // depends on them and it is hard to figure out what. Any user types added in |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 virtual Profile* GetProfileByUser(const User* user) const = 0; | 221 virtual Profile* GetProfileByUser(const User* user) const = 0; |
222 | 222 |
223 // Saves user's oauth token status in local state preferences. | 223 // Saves user's oauth token status in local state preferences. |
224 virtual void SaveUserOAuthStatus( | 224 virtual void SaveUserOAuthStatus( |
225 const std::string& user_id, | 225 const std::string& user_id, |
226 User::OAuthTokenStatus oauth_token_status) = 0; | 226 User::OAuthTokenStatus oauth_token_status) = 0; |
227 | 227 |
228 // Saves user's displayed name in local state preferences. | 228 // Saves user's displayed name in local state preferences. |
229 // Ignored If there is no such user. | 229 // Ignored If there is no such user. |
230 virtual void SaveUserDisplayName(const std::string& user_id, | 230 virtual void SaveUserDisplayName(const std::string& user_id, |
231 const string16& display_name) = 0; | 231 const base::string16& display_name) = 0; |
232 | 232 |
233 // Updates data upon User Account download. | 233 // Updates data upon User Account download. |
234 virtual void UpdateUserAccountData(const std::string& user_id, | 234 virtual void UpdateUserAccountData(const std::string& user_id, |
235 const UserAccountData& account_data) = 0; | 235 const UserAccountData& account_data) = 0; |
236 | 236 |
237 // Returns the display name for user |user_id| if it is known (was | 237 // Returns the display name for user |user_id| if it is known (was |
238 // previously set by a |SaveUserDisplayName| call). | 238 // previously set by a |SaveUserDisplayName| call). |
239 // Otherwise, returns an empty string. | 239 // Otherwise, returns an empty string. |
240 virtual string16 GetUserDisplayName( | 240 virtual base::string16 GetUserDisplayName( |
241 const std::string& user_id) const = 0; | 241 const std::string& user_id) const = 0; |
242 | 242 |
243 // Saves user's displayed (non-canonical) email in local state preferences. | 243 // Saves user's displayed (non-canonical) email in local state preferences. |
244 // Ignored If there is no such user. | 244 // Ignored If there is no such user. |
245 virtual void SaveUserDisplayEmail(const std::string& user_id, | 245 virtual void SaveUserDisplayEmail(const std::string& user_id, |
246 const std::string& display_email) = 0; | 246 const std::string& display_email) = 0; |
247 | 247 |
248 // Returns the display email for user |user_id| if it is known (was | 248 // Returns the display email for user |user_id| if it is known (was |
249 // previously set by a |SaveUserDisplayEmail| call). | 249 // previously set by a |SaveUserDisplayEmail| call). |
250 // Otherwise, returns |user_id| itself. | 250 // Otherwise, returns |user_id| itself. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 ScopedTestUserManager(); | 390 ScopedTestUserManager(); |
391 ~ScopedTestUserManager(); | 391 ~ScopedTestUserManager(); |
392 | 392 |
393 private: | 393 private: |
394 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); | 394 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); |
395 }; | 395 }; |
396 | 396 |
397 } // namespace chromeos | 397 } // namespace chromeos |
398 | 398 |
399 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 399 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
OLD | NEW |