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

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: Fix Multi Profile support. 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 virtual void RemoveUser(const std::string& email, 65 virtual void RemoveUser(const std::string& email,
66 RemoveUserDelegate* delegate) OVERRIDE; 66 RemoveUserDelegate* delegate) OVERRIDE;
67 virtual void RemoveUserFromList(const std::string& email) OVERRIDE; 67 virtual void RemoveUserFromList(const std::string& email) OVERRIDE;
68 virtual bool IsKnownUser(const std::string& email) const OVERRIDE; 68 virtual bool IsKnownUser(const std::string& email) const OVERRIDE;
69 virtual const User* FindUser(const std::string& email) const OVERRIDE; 69 virtual const User* FindUser(const std::string& email) const OVERRIDE;
70 virtual const User* FindLocallyManagedUser( 70 virtual const User* FindLocallyManagedUser(
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 const User* GetPrimaryUser() const OVERRIDE;
75 virtual User* GetActiveUser() OVERRIDE; 76 virtual User* GetActiveUser() OVERRIDE;
76 virtual void SaveUserOAuthStatus( 77 virtual void SaveUserOAuthStatus(
77 const std::string& username, 78 const std::string& username,
78 User::OAuthTokenStatus oauth_token_status) OVERRIDE; 79 User::OAuthTokenStatus oauth_token_status) OVERRIDE;
79 virtual void SaveUserDisplayName(const std::string& username, 80 virtual void SaveUserDisplayName(const std::string& username,
80 const string16& display_name) OVERRIDE; 81 const string16& display_name) OVERRIDE;
82 virtual void UpdateUserAccountData(const std::string& username,
83 const string16& display_name,
84 const std::string& locale) OVERRIDE;
81 virtual string16 GetUserDisplayName( 85 virtual string16 GetUserDisplayName(
82 const std::string& username) const OVERRIDE; 86 const std::string& username) const OVERRIDE;
83 virtual void SaveUserDisplayEmail(const std::string& username, 87 virtual void SaveUserDisplayEmail(const std::string& username,
84 const std::string& display_email) OVERRIDE; 88 const std::string& display_email) OVERRIDE;
85 virtual std::string GetUserDisplayEmail( 89 virtual std::string GetUserDisplayEmail(
86 const std::string& username) const OVERRIDE; 90 const std::string& username) const OVERRIDE;
87 virtual string16 GetManagerDisplayNameForManagedUser( 91 virtual string16 GetManagerDisplayNameForManagedUser(
88 const std::string& managed_user_id) const OVERRIDE; 92 const std::string& managed_user_id) const OVERRIDE;
89 virtual std::string GetManagerUserIdForManagedUser( 93 virtual std::string GetManagerUserIdForManagedUser(
90 const std::string& managed_user_id) const OVERRIDE; 94 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, 148 const content::NotificationSource& source,
145 const content::NotificationDetails& details) OVERRIDE; 149 const content::NotificationDetails& details) OVERRIDE;
146 150
147 // ProfileSyncServiceObserver implementation. 151 // ProfileSyncServiceObserver implementation.
148 virtual void OnStateChanged() OVERRIDE; 152 virtual void OnStateChanged() OVERRIDE;
149 153
150 // policy::DeviceLocalAccountPolicyService::Observer implementation. 154 // policy::DeviceLocalAccountPolicyService::Observer implementation.
151 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE; 155 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE;
152 virtual void OnDeviceLocalAccountsChanged() OVERRIDE; 156 virtual void OnDeviceLocalAccountsChanged() OVERRIDE;
153 157
158 // Wait untill we have sufficient information on user locale and apply it.
159 void RespectLocalePreference(Profile* profile, const User* user) const;
160
154 private: 161 private:
155 friend class UserManager; 162 friend class UserManager;
156 friend class WallpaperManager; 163 friend class WallpaperManager;
157 friend class UserManagerTest; 164 friend class UserManagerTest;
158 friend class WallpaperManagerTest; 165 friend class WallpaperManagerTest;
159 166
160 UserManagerImpl(); 167 UserManagerImpl();
161 168
162 // LoginUtils::Delegate implementation: 169 // LoginUtils::Delegate implementation:
163 // Used when restoring user sessions after crash. 170 // Used when restoring user sessions after crash.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 305
299 // Called by OnRestoreActiveSessions() when there're user sessions in 306 // Called by OnRestoreActiveSessions() when there're user sessions in
300 // |pending_user_sessions_| that has to be restored one by one. 307 // |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. 308 // 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. 309 // Process continues till |pending_user_sessions_| map is not empty.
303 void RestorePendingUserSessions(); 310 void RestorePendingUserSessions();
304 311
305 // Sends metrics in response to a regular user logging in. 312 // Sends metrics in response to a regular user logging in.
306 void SendRegularUserLoginMetrics(const std::string& email); 313 void SendRegularUserLoginMetrics(const std::string& email);
307 314
315 // UpdateUserAccountData() + SaveUserDisplayName() .
316 void UpdateUserAccountDataImpl(const std::string& username,
317 const string16& display_name,
318 const std::string* locale);
319
320 // Returns NULL if User is not created.
321 User* GetUserByProfile(Profile* profile) const;
322
323 Profile* GetProfileByUser(const User* user) const;
324
308 // Interface to the signed settings store. 325 // Interface to the signed settings store.
309 CrosSettings* cros_settings_; 326 CrosSettings* cros_settings_;
310 327
311 // Interface to device-local account definitions and associated policy. 328 // Interface to device-local account definitions and associated policy.
312 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; 329 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_;
313 330
314 // True if users have been loaded from prefs already. 331 // True if users have been loaded from prefs already.
315 bool users_loaded_; 332 bool users_loaded_;
316 333
317 // List of all known users. User instances are owned by |this|. Regular users 334 // 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 432
416 // Time at which this object was created. 433 // Time at which this object was created.
417 base::TimeTicks manager_creation_time_; 434 base::TimeTicks manager_creation_time_;
418 435
419 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 436 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
420 }; 437 };
421 438
422 } // namespace chromeos 439 } // namespace chromeos
423 440
424 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 441 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698