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

Unified Diff: chrome/browser/chromeos/login/screens/user_image_screen.h

Issue 2568973002: chromeos: Replace user image notifications with observer (Closed)
Patch Set: rebase Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/screens/user_image_screen.h
diff --git a/chrome/browser/chromeos/login/screens/user_image_screen.h b/chrome/browser/chromeos/login/screens/user_image_screen.h
index 08bcce845cc94119e97041efc6c4eb6a6b3c6622..ed70f75065b69892467f35393ee6b57ddf92e5b7 100644
--- a/chrome/browser/chromeos/login/screens/user_image_screen.h
+++ b/chrome/browser/chromeos/login/screens/user_image_screen.h
@@ -16,8 +16,7 @@
#include "chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h"
#include "chrome/browser/image_decoder.h"
#include "components/user_manager/user.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "components/user_manager/user_manager.h"
namespace base {
class Timer;
@@ -36,7 +35,7 @@ class UserImageView;
class UserImageScreen : public UserImageModel,
public ImageDecoder::ImageRequest,
- public content::NotificationObserver,
+ public user_manager::UserManager::Observer,
public UserImageSyncObserver::Observer,
public CameraPresenceNotifier::Observer {
public:
@@ -59,10 +58,11 @@ class UserImageScreen : public UserImageModel,
void OnImageAccepted() override;
void OnViewDestroyed(UserImageView* view) override;
- // content::NotificationObserver implementation:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ // user_manager::UserManager::Observer implementation:
+ void OnUserImageChanged(const user_manager::User& user) override;
+ void OnUserProfileImageUpdateFailed(const user_manager::User& user) override;
+ void OnUserProfileImageUpdated(const user_manager::User& user,
+ const gfx::ImageSkia& profile_image) override;
// ImageDecoder::ImageRequest implementation:
void OnImageDecoded(const SkBitmap& decoded_image) override;
@@ -115,8 +115,6 @@ class UserImageScreen : public UserImageModel,
// Reports sync duration and result to UMA.
void ReportSyncResult(SyncResult timed_out) const;
- content::NotificationRegistrar notification_registrar_;
-
std::unique_ptr<policy::PolicyChangeRegistrar> policy_registrar_;
UserImageView* view_;
« no previous file with comments | « chrome/browser/chrome_notification_types.h ('k') | chrome/browser/chromeos/login/screens/user_image_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698