| OLD | NEW |
| 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/profiles/profile_downloader_delegate.h" | 23 #include "chrome/browser/profiles/profile_downloader_delegate.h" |
| 24 #include "chrome/browser/sync/profile_sync_service_observer.h" | 24 #include "chrome/browser/sync/profile_sync_service_observer.h" |
| 25 #include "content/public/browser/notification_observer.h" | 25 #include "content/public/browser/notification_observer.h" |
| 26 #include "content/public/browser/notification_registrar.h" | 26 #include "content/public/browser/notification_registrar.h" |
| 27 #include "ui/gfx/image/image_skia.h" |
| 27 | 28 |
| 28 class SkBitmap; | 29 class SkBitmap; |
| 29 class FilePath; | 30 class FilePath; |
| 30 class PrefService; | 31 class PrefService; |
| 31 class ProfileDownloader; | 32 class ProfileDownloader; |
| 32 class ProfileSyncService; | 33 class ProfileSyncService; |
| 33 | 34 |
| 34 namespace chromeos { | 35 namespace chromeos { |
| 35 | 36 |
| 36 class RemoveUserDelegate; | 37 class RemoveUserDelegate; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(Observer* obs) OVERRIDE; |
| 95 virtual void RemoveObserver(Observer* obs) OVERRIDE; | 96 virtual void RemoveObserver(Observer* obs) OVERRIDE; |
| 96 virtual void NotifyLocalStateChanged() OVERRIDE; | 97 virtual void NotifyLocalStateChanged() OVERRIDE; |
| 97 virtual const SkBitmap& DownloadedProfileImage() const OVERRIDE; | 98 virtual const gfx::ImageSkia& 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; |
| 106 | 107 |
| 107 protected: | 108 protected: |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 294 |
| 294 // Time when the profile image download has started. | 295 // Time when the profile image download has started. |
| 295 base::Time profile_image_load_start_time_; | 296 base::Time profile_image_load_start_time_; |
| 296 | 297 |
| 297 // True if the last user image required async save operation (which may not | 298 // True if the last user image required async save operation (which may not |
| 298 // have been completed yet). This flag is used to avoid races when user image | 299 // have been completed yet). This flag is used to avoid races when user image |
| 299 // is first set with |SaveUserImage| and then with |SaveUserImagePath|. | 300 // is first set with |SaveUserImage| and then with |SaveUserImagePath|. |
| 300 bool last_image_set_async_; | 301 bool last_image_set_async_; |
| 301 | 302 |
| 302 // Result of the last successful profile image download, if any. | 303 // Result of the last successful profile image download, if any. |
| 303 SkBitmap downloaded_profile_image_; | 304 gfx::ImageSkia downloaded_profile_image_; |
| 304 | 305 |
| 305 // Data URL for |downloaded_profile_image_|. | 306 // Data URL for |downloaded_profile_image_|. |
| 306 std::string downloaded_profile_image_data_url_; | 307 std::string downloaded_profile_image_data_url_; |
| 307 | 308 |
| 308 // Original URL of |downloaded_profile_image_|, from which it was downloaded. | 309 // Original URL of |downloaded_profile_image_|, from which it was downloaded. |
| 309 GURL profile_image_url_; | 310 GURL profile_image_url_; |
| 310 | 311 |
| 311 // True when |profile_image_downloader_| is fetching profile picture (not | 312 // True when |profile_image_downloader_| is fetching profile picture (not |
| 312 // just full name). | 313 // just full name). |
| 313 bool downloading_profile_image_; | 314 bool downloading_profile_image_; |
| 314 | 315 |
| 315 // Timer triggering DownloadProfileDataScheduled for refreshing profile data. | 316 // Timer triggering DownloadProfileDataScheduled for refreshing profile data. |
| 316 base::RepeatingTimer<UserManagerImpl> profile_download_timer_; | 317 base::RepeatingTimer<UserManagerImpl> profile_download_timer_; |
| 317 | 318 |
| 318 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); | 319 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); |
| 319 }; | 320 }; |
| 320 | 321 |
| 321 } // namespace chromeos | 322 } // namespace chromeos |
| 322 | 323 |
| 323 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ | 324 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ |
| OLD | NEW |