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

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

Issue 10832035: Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, remove blocking GetOwnershipStatus() Created 8 years, 4 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 | Annotate | Revision Log
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 <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/hash_tables.h" 11 #include "base/hash_tables.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/synchronization/lock.h" 16 #include "base/synchronization/lock.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "base/timer.h" 18 #include "base/timer.h"
19 #include "chrome/browser/chromeos/login/user.h" 19 #include "chrome/browser/chromeos/login/user.h"
20 #include "chrome/browser/chromeos/login/user_image_loader.h" 20 #include "chrome/browser/chromeos/login/user_image_loader.h"
21 #include "chrome/browser/chromeos/login/user_manager.h" 21 #include "chrome/browser/chromeos/login/user_manager.h"
22 #include "chrome/browser/chromeos/login/wallpaper_manager.h" 22 #include "chrome/browser/chromeos/login/wallpaper_manager.h"
23 #include "chrome/browser/chromeos/settings/device_settings_service.h"
23 #include "chrome/browser/profiles/profile_downloader_delegate.h" 24 #include "chrome/browser/profiles/profile_downloader_delegate.h"
24 #include "chrome/browser/sync/profile_sync_service_observer.h" 25 #include "chrome/browser/sync/profile_sync_service_observer.h"
25 #include "content/public/browser/notification_observer.h" 26 #include "content/public/browser/notification_observer.h"
26 #include "content/public/browser/notification_registrar.h" 27 #include "content/public/browser/notification_registrar.h"
27 28
28 class SkBitmap;
29 class FilePath; 29 class FilePath;
30 class PrefService; 30 class PrefService;
31 class ProfileDownloader; 31 class ProfileDownloader;
32 class ProfileSyncService; 32 class ProfileSyncService;
33 class SkBitmap;
33 34
34 namespace chromeos { 35 namespace chromeos {
35 36
36 class RemoveUserDelegate; 37 class RemoveUserDelegate;
37 class UserImage; 38 class UserImage;
38 39
39 // Implementation of the UserManager. 40 // Implementation of the UserManager.
40 class UserManagerImpl : public UserManager, 41 class UserManagerImpl : public UserManager,
41 public ProfileDownloaderDelegate, 42 public ProfileDownloaderDelegate,
42 public ProfileSyncServiceObserver, 43 public ProfileSyncServiceObserver,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 const std::string& username) OVERRIDE; 85 const std::string& username) OVERRIDE;
85 virtual void DownloadProfileImage(const std::string& reason) OVERRIDE; 86 virtual void DownloadProfileImage(const std::string& reason) OVERRIDE;
86 virtual bool IsCurrentUserOwner() const OVERRIDE; 87 virtual bool IsCurrentUserOwner() const OVERRIDE;
87 virtual bool IsCurrentUserNew() const OVERRIDE; 88 virtual bool IsCurrentUserNew() const OVERRIDE;
88 virtual bool IsCurrentUserEphemeral() const OVERRIDE; 89 virtual bool IsCurrentUserEphemeral() const OVERRIDE;
89 virtual bool IsUserLoggedIn() const OVERRIDE; 90 virtual bool IsUserLoggedIn() const OVERRIDE;
90 virtual bool IsLoggedInAsDemoUser() const OVERRIDE; 91 virtual bool IsLoggedInAsDemoUser() const OVERRIDE;
91 virtual bool IsLoggedInAsGuest() const OVERRIDE; 92 virtual bool IsLoggedInAsGuest() const OVERRIDE;
92 virtual bool IsLoggedInAsStub() const OVERRIDE; 93 virtual bool IsLoggedInAsStub() const OVERRIDE;
93 virtual bool IsSessionStarted() const OVERRIDE; 94 virtual bool IsSessionStarted() const OVERRIDE;
94 virtual void AddObserver(Observer* obs) OVERRIDE; 95 virtual void AddObserver(UserManager::Observer* obs) OVERRIDE;
95 virtual void RemoveObserver(Observer* obs) OVERRIDE; 96 virtual void RemoveObserver(UserManager::Observer* obs) OVERRIDE;
96 virtual void NotifyLocalStateChanged() OVERRIDE; 97 virtual void NotifyLocalStateChanged() OVERRIDE;
97 virtual const SkBitmap& DownloadedProfileImage() const OVERRIDE; 98 virtual const SkBitmap& DownloadedProfileImage() const OVERRIDE;
98 99
99 // content::NotificationObserver implementation. 100 // content::NotificationObserver implementation.
100 virtual void Observe(int type, 101 virtual void Observe(int type,
101 const content::NotificationSource& source, 102 const content::NotificationSource& source,
102 const content::NotificationDetails& details) OVERRIDE; 103 const content::NotificationDetails& details) OVERRIDE;
103 104
104 // ProfileSyncServiceObserver implementation. 105 // ProfileSyncServiceObserver implementation.
105 virtual void OnStateChanged() OVERRIDE; 106 virtual void OnStateChanged() OVERRIDE;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // download times). 209 // download times).
209 void DownloadProfileData(const std::string& reason, bool download_image); 210 void DownloadProfileData(const std::string& reason, bool download_image);
210 211
211 // Scheduled call for downloading profile data. 212 // Scheduled call for downloading profile data.
212 void DownloadProfileDataScheduled(); 213 void DownloadProfileDataScheduled();
213 214
214 // Deletes user's image file. Runs on FILE thread. 215 // Deletes user's image file. Runs on FILE thread.
215 void DeleteUserImage(const FilePath& image_path); 216 void DeleteUserImage(const FilePath& image_path);
216 217
217 // Updates current user ownership on UI thread. 218 // Updates current user ownership on UI thread.
218 void UpdateOwnership(bool is_owner); 219 void UpdateOwnership(DeviceSettingsService::OwnershipStatus status,
220 bool is_owner);
219 221
220 // Checks current user's ownership on file thread. 222 // Triggers an asynchronous ownership check.
221 void CheckOwnership(); 223 void CheckOwnership();
222 224
223 // ProfileDownloaderDelegate implementation. 225 // ProfileDownloaderDelegate implementation.
224 virtual bool NeedsProfilePicture() const OVERRIDE; 226 virtual bool NeedsProfilePicture() const OVERRIDE;
225 virtual int GetDesiredImageSideLength() const OVERRIDE; 227 virtual int GetDesiredImageSideLength() const OVERRIDE;
226 virtual Profile* GetBrowserProfile() OVERRIDE; 228 virtual Profile* GetBrowserProfile() OVERRIDE;
227 virtual std::string GetCachedPictureURL() const OVERRIDE; 229 virtual std::string GetCachedPictureURL() const OVERRIDE;
228 virtual void OnProfileDownloadSuccess(ProfileDownloader* downloader) OVERRIDE; 230 virtual void OnProfileDownloadSuccess(ProfileDownloader* downloader) OVERRIDE;
229 virtual void OnProfileDownloadFailure(ProfileDownloader* downloader) OVERRIDE; 231 virtual void OnProfileDownloadFailure(ProfileDownloader* downloader) OVERRIDE;
230 232
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // been read from trusted device policy yet. 278 // been read from trusted device policy yet.
277 std::string owner_email_; 279 std::string owner_email_;
278 280
279 content::NotificationRegistrar registrar_; 281 content::NotificationRegistrar registrar_;
280 282
281 // Profile sync service which is observed to take actions after sync 283 // Profile sync service which is observed to take actions after sync
282 // errors appear. NOTE: there is no guarantee that it is the current sync 284 // errors appear. NOTE: there is no guarantee that it is the current sync
283 // service, so do NOT use it outside |OnStateChanged| method. 285 // service, so do NOT use it outside |OnStateChanged| method.
284 ProfileSyncService* observed_sync_service_; 286 ProfileSyncService* observed_sync_service_;
285 287
286 ObserverList<Observer> observer_list_; 288 ObserverList<UserManager::Observer> observer_list_;
287 289
288 // Download user profile image on login to update it if it's changed. 290 // Download user profile image on login to update it if it's changed.
289 scoped_ptr<ProfileDownloader> profile_image_downloader_; 291 scoped_ptr<ProfileDownloader> profile_image_downloader_;
290 292
291 // Arbitrary string passed to the last |DownloadProfileImage| call. 293 // Arbitrary string passed to the last |DownloadProfileImage| call.
292 std::string profile_image_download_reason_; 294 std::string profile_image_download_reason_;
293 295
294 // Time when the profile image download has started. 296 // Time when the profile image download has started.
295 base::Time profile_image_load_start_time_; 297 base::Time profile_image_load_start_time_;
296 298
(...skipping 17 matching lines...) Expand all
314 316
315 // Timer triggering DownloadProfileDataScheduled for refreshing profile data. 317 // Timer triggering DownloadProfileDataScheduled for refreshing profile data.
316 base::RepeatingTimer<UserManagerImpl> profile_download_timer_; 318 base::RepeatingTimer<UserManagerImpl> profile_download_timer_;
317 319
318 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 320 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
319 }; 321 };
320 322
321 } // namespace chromeos 323 } // namespace chromeos
322 324
323 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 325 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698