Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.h

Issue 23095006: If user profile doesn't contain language setting, default to his Google account settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment on "list of preferred languages". Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_IMPL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const string16& display_name) const OVERRIDE; 71 const string16& display_name) const OVERRIDE;
72 virtual const User* GetLoggedInUser() const OVERRIDE; 72 virtual const User* GetLoggedInUser() const OVERRIDE;
73 virtual User* GetLoggedInUser() OVERRIDE; 73 virtual User* GetLoggedInUser() OVERRIDE;
74 virtual const User* GetActiveUser() const OVERRIDE; 74 virtual const User* GetActiveUser() const OVERRIDE;
75 virtual User* GetActiveUser() OVERRIDE; 75 virtual User* GetActiveUser() OVERRIDE;
76 virtual void SaveUserOAuthStatus( 76 virtual void SaveUserOAuthStatus(
77 const std::string& username, 77 const std::string& username,
78 User::OAuthTokenStatus oauth_token_status) OVERRIDE; 78 User::OAuthTokenStatus oauth_token_status) OVERRIDE;
79 virtual void SaveUserDisplayName(const std::string& username, 79 virtual void SaveUserDisplayName(const std::string& username,
80 const string16& display_name) OVERRIDE; 80 const string16& display_name) OVERRIDE;
81 virtual void UpdateUserAccountData(const std::string& username,
82 const string16& display_name,
83 const std::string& locale) OVERRIDE;
81 virtual string16 GetUserDisplayName( 84 virtual string16 GetUserDisplayName(
82 const std::string& username) const OVERRIDE; 85 const std::string& username) const OVERRIDE;
83 virtual void SaveUserDisplayEmail(const std::string& username, 86 virtual void SaveUserDisplayEmail(const std::string& username,
84 const std::string& display_email) OVERRIDE; 87 const std::string& display_email) OVERRIDE;
85 virtual std::string GetUserDisplayEmail( 88 virtual std::string GetUserDisplayEmail(
86 const std::string& username) const OVERRIDE; 89 const std::string& username) const OVERRIDE;
87 virtual string16 GetManagerDisplayNameForManagedUser( 90 virtual string16 GetManagerDisplayNameForManagedUser(
88 const std::string& managed_user_id) const OVERRIDE; 91 const std::string& managed_user_id) const OVERRIDE;
89 virtual std::string GetManagerUserIdForManagedUser( 92 virtual std::string GetManagerUserIdForManagedUser(
90 const std::string& managed_user_id) const OVERRIDE; 93 const std::string& managed_user_id) const OVERRIDE;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const content::NotificationSource& source, 147 const content::NotificationSource& source,
145 const content::NotificationDetails& details) OVERRIDE; 148 const content::NotificationDetails& details) OVERRIDE;
146 149
147 // ProfileSyncServiceObserver implementation. 150 // ProfileSyncServiceObserver implementation.
148 virtual void OnStateChanged() OVERRIDE; 151 virtual void OnStateChanged() OVERRIDE;
149 152
150 // policy::DeviceLocalAccountPolicyService::Observer implementation. 153 // policy::DeviceLocalAccountPolicyService::Observer implementation.
151 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE; 154 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE;
152 virtual void OnDeviceLocalAccountsChanged() OVERRIDE; 155 virtual void OnDeviceLocalAccountsChanged() OVERRIDE;
153 156
157 // Wait untill we have sufficient information on user locale and apply it.
158 void RespectLocalePreference(Profile* profile, const User* user) const;
159
154 private: 160 private:
155 friend class UserManager; 161 friend class UserManager;
156 friend class WallpaperManager; 162 friend class WallpaperManager;
157 friend class UserManagerTest; 163 friend class UserManagerTest;
158 friend class WallpaperManagerTest; 164 friend class WallpaperManagerTest;
159 165
160 UserManagerImpl(); 166 UserManagerImpl();
161 167
162 // LoginUtils::Delegate implementation: 168 // LoginUtils::Delegate implementation:
163 // Used when restoring user sessions after crash. 169 // Used when restoring user sessions after crash.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 304
299 // Called by OnRestoreActiveSessions() when there're user sessions in 305 // Called by OnRestoreActiveSessions() when there're user sessions in
300 // |pending_user_sessions_| that has to be restored one by one. 306 // |pending_user_sessions_| that has to be restored one by one.
301 // Also called after first user session from that list is restored and so on. 307 // Also called after first user session from that list is restored and so on.
302 // Process continues till |pending_user_sessions_| map is not empty. 308 // Process continues till |pending_user_sessions_| map is not empty.
303 void RestorePendingUserSessions(); 309 void RestorePendingUserSessions();
304 310
305 // Sends metrics in response to a regular user logging in. 311 // Sends metrics in response to a regular user logging in.
306 void SendRegularUserLoginMetrics(const std::string& email); 312 void SendRegularUserLoginMetrics(const std::string& email);
307 313
314 // UpdateUserAccountData() + SaveUserDisplayName() .
315 void UpdateUserAccountDataImpl(const std::string& username,
316 const string16& display_name,
317 const std::string* locale);
318
319 // Returns NULL if User is not created.
320 User* GetUserByProfile(Profile* profile);
321
308 // Interface to the signed settings store. 322 // Interface to the signed settings store.
309 CrosSettings* cros_settings_; 323 CrosSettings* cros_settings_;
310 324
311 // Interface to device-local account definitions and associated policy. 325 // Interface to device-local account definitions and associated policy.
312 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; 326 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_;
313 327
314 // True if users have been loaded from prefs already. 328 // True if users have been loaded from prefs already.
315 bool users_loaded_; 329 bool users_loaded_;
316 330
317 // List of all known users. User instances are owned by |this|. Regular users 331 // List of all known users. User instances are owned by |this|. Regular users
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 429
416 // Time at which this object was created. 430 // Time at which this object was created.
417 base::TimeTicks manager_creation_time_; 431 base::TimeTicks manager_creation_time_;
418 432
419 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 433 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
420 }; 434 };
421 435
422 } // namespace chromeos 436 } // namespace chromeos
423 437
424 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 438 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698