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

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 tests. Created 7 years, 2 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const User* GetPrimaryUser() const OVERRIDE; 76 virtual const User* GetPrimaryUser() const OVERRIDE;
77 virtual void SaveUserOAuthStatus( 77 virtual void SaveUserOAuthStatus(
78 const std::string& username, 78 const std::string& username,
79 User::OAuthTokenStatus oauth_token_status) OVERRIDE; 79 User::OAuthTokenStatus oauth_token_status) OVERRIDE;
80 virtual void SaveUserDisplayName(const std::string& username, 80 virtual void SaveUserDisplayName(const std::string& username,
81 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;
82 virtual string16 GetUserDisplayName( 85 virtual string16 GetUserDisplayName(
83 const std::string& username) const OVERRIDE; 86 const std::string& username) const OVERRIDE;
84 virtual void SaveUserDisplayEmail(const std::string& username, 87 virtual void SaveUserDisplayEmail(const std::string& username,
85 const std::string& display_email) OVERRIDE; 88 const std::string& display_email) OVERRIDE;
86 virtual std::string GetUserDisplayEmail( 89 virtual std::string GetUserDisplayEmail(
87 const std::string& username) const OVERRIDE; 90 const std::string& username) const OVERRIDE;
88 virtual std::string GetManagedUserSyncId( 91 virtual std::string GetManagedUserSyncId(
89 const std::string& managed_user_id) const OVERRIDE; 92 const std::string& managed_user_id) const OVERRIDE;
90 virtual string16 GetManagerDisplayNameForManagedUser( 93 virtual string16 GetManagerDisplayNameForManagedUser(
91 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
145 148
146 // content::NotificationObserver implementation. 149 // content::NotificationObserver implementation.
147 virtual void Observe(int type, 150 virtual void Observe(int type,
148 const content::NotificationSource& source, 151 const content::NotificationSource& source,
149 const content::NotificationDetails& details) OVERRIDE; 152 const content::NotificationDetails& details) OVERRIDE;
150 153
151 // policy::DeviceLocalAccountPolicyService::Observer implementation. 154 // policy::DeviceLocalAccountPolicyService::Observer implementation.
152 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE; 155 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE;
153 virtual void OnDeviceLocalAccountsChanged() OVERRIDE; 156 virtual void OnDeviceLocalAccountsChanged() OVERRIDE;
154 157
158 // Wait untill we have sufficient information on user locale and apply it.
159 void RespectLocalePreference(Profile* profile, const User* user) const;
160
155 private: 161 private:
156 friend class UserManager; 162 friend class UserManager;
157 friend class WallpaperManager; 163 friend class WallpaperManager;
158 friend class UserManagerTest; 164 friend class UserManagerTest;
159 friend class WallpaperManagerTest; 165 friend class WallpaperManagerTest;
160 166
161 UserManagerImpl(); 167 UserManagerImpl();
162 168
163 // LoginUtils::Delegate implementation: 169 // LoginUtils::Delegate implementation:
164 // Used when restoring user sessions after crash. 170 // Used when restoring user sessions after crash.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 301
296 // Called by OnRestoreActiveSessions() when there're user sessions in 302 // Called by OnRestoreActiveSessions() when there're user sessions in
297 // |pending_user_sessions_| that has to be restored one by one. 303 // |pending_user_sessions_| that has to be restored one by one.
298 // Also called after first user session from that list is restored and so on. 304 // Also called after first user session from that list is restored and so on.
299 // Process continues till |pending_user_sessions_| map is not empty. 305 // Process continues till |pending_user_sessions_| map is not empty.
300 void RestorePendingUserSessions(); 306 void RestorePendingUserSessions();
301 307
302 // Sends metrics in response to a regular user logging in. 308 // Sends metrics in response to a regular user logging in.
303 void SendRegularUserLoginMetrics(const std::string& email); 309 void SendRegularUserLoginMetrics(const std::string& email);
304 310
311 // UpdateUserAccountData() + SaveUserDisplayName() .
312 void UpdateUserAccountDataImpl(const std::string& username,
313 const string16& display_name,
314 const std::string* locale);
315
316 // Returns NULL if User is not created.
317 User* GetUserByProfile(Profile* profile) const;
318
319 Profile* GetProfileByUser(const User* user) const;
320
305 // Interface to the signed settings store. 321 // Interface to the signed settings store.
306 CrosSettings* cros_settings_; 322 CrosSettings* cros_settings_;
307 323
308 // Interface to device-local account definitions and associated policy. 324 // Interface to device-local account definitions and associated policy.
309 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; 325 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_;
310 326
311 // True if users have been loaded from prefs already. 327 // True if users have been loaded from prefs already.
312 bool users_loaded_; 328 bool users_loaded_;
313 329
314 // List of all known users. User instances are owned by |this|. Regular users 330 // List of all known users. User instances are owned by |this|. Regular users
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 local_accounts_subscription_; 424 local_accounts_subscription_;
409 scoped_ptr<CrosSettings::ObserverSubscription> 425 scoped_ptr<CrosSettings::ObserverSubscription>
410 supervised_users_subscription_; 426 supervised_users_subscription_;
411 427
412 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 428 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
413 }; 429 };
414 430
415 } // namespace chromeos 431 } // namespace chromeos
416 432
417 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 433 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager.h ('k') | chrome/browser/chromeos/login/user_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698