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

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. Created 8 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 | 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 #include "ui/gfx/image/image_skia.h" 28 #include "ui/gfx/image/image_skia.h"
28 29
29 class SkBitmap;
30 class FilePath; 30 class FilePath;
31 class PrefService; 31 class PrefService;
32 class ProfileDownloader; 32 class ProfileDownloader;
33 class ProfileSyncService; 33 class ProfileSyncService;
34 class SkBitmap;
34 35
35 namespace chromeos { 36 namespace chromeos {
36 37
37 class RemoveUserDelegate; 38 class RemoveUserDelegate;
38 class UserImage; 39 class UserImage;
39 40
40 // Implementation of the UserManager. 41 // Implementation of the UserManager.
41 class UserManagerImpl : public UserManager, 42 class UserManagerImpl : public UserManager,
42 public ProfileDownloaderDelegate, 43 public ProfileDownloaderDelegate,
43 public ProfileSyncServiceObserver, 44 public ProfileSyncServiceObserver,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 virtual void DownloadProfileImage(const std::string& reason) OVERRIDE; 87 virtual void DownloadProfileImage(const std::string& reason) OVERRIDE;
87 virtual bool IsCurrentUserOwner() const OVERRIDE; 88 virtual bool IsCurrentUserOwner() const OVERRIDE;
88 virtual bool IsCurrentUserNew() const OVERRIDE; 89 virtual bool IsCurrentUserNew() const OVERRIDE;
89 virtual bool IsCurrentUserEphemeral() const OVERRIDE; 90 virtual bool IsCurrentUserEphemeral() const OVERRIDE;
90 virtual bool IsUserLoggedIn() const OVERRIDE; 91 virtual bool IsUserLoggedIn() const OVERRIDE;
91 virtual bool IsLoggedInAsDemoUser() const OVERRIDE; 92 virtual bool IsLoggedInAsDemoUser() const OVERRIDE;
92 virtual bool IsLoggedInAsGuest() const OVERRIDE; 93 virtual bool IsLoggedInAsGuest() const OVERRIDE;
93 virtual bool IsLoggedInAsStub() const OVERRIDE; 94 virtual bool IsLoggedInAsStub() const OVERRIDE;
94 virtual bool IsSessionStarted() const OVERRIDE; 95 virtual bool IsSessionStarted() const OVERRIDE;
95 virtual bool IsEphemeralUser(const std::string& email) const OVERRIDE; 96 virtual bool IsEphemeralUser(const std::string& email) const OVERRIDE;
96 virtual void AddObserver(Observer* obs) OVERRIDE; 97 virtual void AddObserver(UserManager::Observer* obs) OVERRIDE;
97 virtual void RemoveObserver(Observer* obs) OVERRIDE; 98 virtual void RemoveObserver(UserManager::Observer* obs) OVERRIDE;
98 virtual void NotifyLocalStateChanged() OVERRIDE; 99 virtual void NotifyLocalStateChanged() OVERRIDE;
99 virtual const gfx::ImageSkia& DownloadedProfileImage() const OVERRIDE; 100 virtual const gfx::ImageSkia& DownloadedProfileImage() const OVERRIDE;
100 101
101 // content::NotificationObserver implementation. 102 // content::NotificationObserver implementation.
102 virtual void Observe(int type, 103 virtual void Observe(int type,
103 const content::NotificationSource& source, 104 const content::NotificationSource& source,
104 const content::NotificationDetails& details) OVERRIDE; 105 const content::NotificationDetails& details) OVERRIDE;
105 106
106 // ProfileSyncServiceObserver implementation. 107 // ProfileSyncServiceObserver implementation.
107 virtual void OnStateChanged() OVERRIDE; 108 virtual void OnStateChanged() OVERRIDE;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // download times). 207 // download times).
207 void DownloadProfileData(const std::string& reason, bool download_image); 208 void DownloadProfileData(const std::string& reason, bool download_image);
208 209
209 // Scheduled call for downloading profile data. 210 // Scheduled call for downloading profile data.
210 void DownloadProfileDataScheduled(); 211 void DownloadProfileDataScheduled();
211 212
212 // Deletes user's image file. Runs on FILE thread. 213 // Deletes user's image file. Runs on FILE thread.
213 void DeleteUserImage(const FilePath& image_path); 214 void DeleteUserImage(const FilePath& image_path);
214 215
215 // Updates current user ownership on UI thread. 216 // Updates current user ownership on UI thread.
216 void UpdateOwnership(bool is_owner); 217 void UpdateOwnership(DeviceSettingsService::OwnershipStatus status,
218 bool is_owner);
217 219
218 // Checks current user's ownership on file thread. 220 // Triggers an asynchronous ownership check.
219 void CheckOwnership(); 221 void CheckOwnership();
220 222
221 // ProfileDownloaderDelegate implementation. 223 // ProfileDownloaderDelegate implementation.
222 virtual bool NeedsProfilePicture() const OVERRIDE; 224 virtual bool NeedsProfilePicture() const OVERRIDE;
223 virtual int GetDesiredImageSideLength() const OVERRIDE; 225 virtual int GetDesiredImageSideLength() const OVERRIDE;
224 virtual Profile* GetBrowserProfile() OVERRIDE; 226 virtual Profile* GetBrowserProfile() OVERRIDE;
225 virtual std::string GetCachedPictureURL() const OVERRIDE; 227 virtual std::string GetCachedPictureURL() const OVERRIDE;
226 virtual void OnProfileDownloadSuccess(ProfileDownloader* downloader) OVERRIDE; 228 virtual void OnProfileDownloadSuccess(ProfileDownloader* downloader) OVERRIDE;
227 virtual void OnProfileDownloadFailure(ProfileDownloader* downloader) OVERRIDE; 229 virtual void OnProfileDownloadFailure(ProfileDownloader* downloader) OVERRIDE;
228 230
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 // been read from trusted device policy yet. 276 // been read from trusted device policy yet.
275 std::string owner_email_; 277 std::string owner_email_;
276 278
277 content::NotificationRegistrar registrar_; 279 content::NotificationRegistrar registrar_;
278 280
279 // Profile sync service which is observed to take actions after sync 281 // Profile sync service which is observed to take actions after sync
280 // errors appear. NOTE: there is no guarantee that it is the current sync 282 // errors appear. NOTE: there is no guarantee that it is the current sync
281 // service, so do NOT use it outside |OnStateChanged| method. 283 // service, so do NOT use it outside |OnStateChanged| method.
282 ProfileSyncService* observed_sync_service_; 284 ProfileSyncService* observed_sync_service_;
283 285
284 ObserverList<Observer> observer_list_; 286 ObserverList<UserManager::Observer> observer_list_;
285 287
286 // Download user profile image on login to update it if it's changed. 288 // Download user profile image on login to update it if it's changed.
287 scoped_ptr<ProfileDownloader> profile_image_downloader_; 289 scoped_ptr<ProfileDownloader> profile_image_downloader_;
288 290
289 // Arbitrary string passed to the last |DownloadProfileImage| call. 291 // Arbitrary string passed to the last |DownloadProfileImage| call.
290 std::string profile_image_download_reason_; 292 std::string profile_image_download_reason_;
291 293
292 // Time when the profile image download has started. 294 // Time when the profile image download has started.
293 base::Time profile_image_load_start_time_; 295 base::Time profile_image_load_start_time_;
294 296
(...skipping 17 matching lines...) Expand all
312 314
313 // Timer triggering DownloadProfileDataScheduled for refreshing profile data. 315 // Timer triggering DownloadProfileDataScheduled for refreshing profile data.
314 base::RepeatingTimer<UserManagerImpl> profile_download_timer_; 316 base::RepeatingTimer<UserManagerImpl> profile_download_timer_;
315 317
316 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 318 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
317 }; 319 };
318 320
319 } // namespace chromeos 321 } // namespace chromeos
320 322
321 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 323 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698