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

Unified Diff: chrome/browser/chromeos/login/user_image_sync_observer.h

Issue 286933002: [cros login] Split login related classes into subfolders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in new tests Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/user_image_sync_observer.h
diff --git a/chrome/browser/chromeos/login/user_image_sync_observer.h b/chrome/browser/chromeos/login/user_image_sync_observer.h
deleted file mode 100644
index 16a9eb7cb1e1dab7f63f2ba3f7a0d03ecdd357d6..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/user_image_sync_observer.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_SYNC_OBSERVER_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_SYNC_OBSERVER_H_
-
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/observer_list.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
-#include "chrome/browser/prefs/pref_service_syncable_observer.h"
-#include "content/public/browser/notification_observer.h"
-
-class PrefChangeRegistrar;
-class PrefServiceSyncable;
-class Profile;
-namespace chromeos {
-class User;
-}
-namespace content {
-class NotificationRegistrar;
-}
-namespace user_prefs {
-class PrefRegistrySyncable;
-}
-
-namespace chromeos {
-
-// This class is responsible for keeping local user image synced with
-// image saved in syncable preference.
-class UserImageSyncObserver: public PrefServiceSyncableObserver,
- public content::NotificationObserver {
- public:
- class Observer {
- public:
- // Called right after image info synced (i.e. |is_synced| became |true|).
- // |local_image_updated| indicates if we desided to update local image in
- // result of sync.
- virtual void OnInitialSync(bool local_image_updated) = 0;
- virtual ~Observer();
- };
-
- public:
- explicit UserImageSyncObserver(const User* user);
- virtual ~UserImageSyncObserver();
-
- // Register syncable preference for profile.
- static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
-
- // Returns |true| if sync was initialized and prefs have actual state.
- bool is_synced() const { return is_synced_; }
-
- // Adds |observer| into observers list.
- void AddObserver(Observer* observer);
- // Removes |observer| from observers list.
- void RemoveObserver(Observer* observer);
-
- private:
- // PrefServiceSyncableObserver implementation.
- virtual void OnIsSyncingChanged() OVERRIDE;
-
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // Called after user profile was loaded.
- void OnProfileGained(Profile* profile);
-
- // Called when sync servise started it's work and we are able to sync needed
- // preferences.
- void OnInitialSync();
-
- // Called when preference |pref_name| was changed.j
- void OnPreferenceChanged(const std::string& pref_name);
-
- // Saves local image preferences to sync.
- void UpdateSyncedImageFromLocal();
-
- // Saves sync preferences to local state and updates user image.
- void UpdateLocalImageFromSynced();
-
- // Gets synced image index. Returns false if user has no needed preferences.
- bool GetSyncedImageIndex(int* result);
-
- // If it is allowed to change user image now.
- bool CanUpdateLocalImageNow();
-
- const User* user_;
- scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
- scoped_ptr<content::NotificationRegistrar> notification_registrar_;
- PrefServiceSyncable* prefs_;
- bool is_synced_;
- // Indicates if local user image changed during initialization.
- bool local_image_changed_;
- ObserverList<Observer> observer_list_;
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_SYNC_OBSERVER_H_
-

Powered by Google App Engine
This is Rietveld 408576698