| Index: chrome/browser/supervised_user/supervised_user_sync_service.h
|
| diff --git a/chrome/browser/managed_mode/managed_user_sync_service.h b/chrome/browser/supervised_user/supervised_user_sync_service.h
|
| similarity index 55%
|
| rename from chrome/browser/managed_mode/managed_user_sync_service.h
|
| rename to chrome/browser/supervised_user/supervised_user_sync_service.h
|
| index 5656ec56bece13c1e59956eecb7747449e35575e..9c3ae1c764fe9edba2d267c53a9ad401bc1fd854 100644
|
| --- a/chrome/browser/managed_mode/managed_user_sync_service.h
|
| +++ b/chrome/browser/supervised_user/supervised_user_sync_service.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SYNC_SERVICE_H_
|
| -#define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SYNC_SERVICE_H_
|
| +#ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SYNC_SERVICE_H_
|
| +#define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SYNC_SERVICE_H_
|
|
|
| #include <vector>
|
|
|
| @@ -11,8 +11,8 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/observer_list.h"
|
| #include "base/prefs/pref_change_registrar.h"
|
| -#include "chrome/browser/managed_mode/managed_user_sync_service_observer.h"
|
| -#include "chrome/browser/managed_mode/managed_users.h"
|
| +#include "chrome/browser/supervised_user/supervised_user_sync_service_observer.h"
|
| +#include "chrome/browser/supervised_user/supervised_users.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
| #include "sync/api/syncable_service.h"
|
|
|
| @@ -26,14 +26,14 @@ class PrefRegistrySyncable;
|
|
|
| class PrefService;
|
|
|
| -class ManagedUserSyncService : public KeyedService,
|
| - public syncer::SyncableService {
|
| +class SupervisedUserSyncService : public KeyedService,
|
| + public syncer::SyncableService {
|
| public:
|
| - // For use with GetManagedUsersAsync() below.
|
| + // For use with GetSupervisedUsersAsync() below.
|
| typedef base::Callback<void(const base::DictionaryValue*)>
|
| - ManagedUsersCallback;
|
| + SupervisedUsersCallback;
|
|
|
| - // Dictionary keys for entry values of |prefs::kManagedUsers|.
|
| + // Dictionary keys for entry values of |prefs::kSupervisedUsers|.
|
| static const char kAcknowledged[];
|
| static const char kChromeAvatar[];
|
| static const char kChromeOsAvatar[];
|
| @@ -45,7 +45,7 @@ class ManagedUserSyncService : public KeyedService,
|
| // Represents a non-existing avatar on Chrome and Chrome OS.
|
| static const int kNoAvatar;
|
|
|
| - virtual ~ManagedUserSyncService();
|
| + virtual ~SupervisedUserSyncService();
|
|
|
| static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
|
|
|
| @@ -54,7 +54,7 @@ class ManagedUserSyncService : public KeyedService,
|
| // index was extracted successfully and false otherwise.
|
| // |avatar_str| should have the format: "chrome-avatar-index:INDEX"
|
| // where INDEX is the integer to be extracted. |avatar_str| can be empty
|
| - // in case there is no avatar synced for a managed user in which case
|
| + // in case there is no avatar synced for a supervised user in which case
|
| // |avatar_index| is set to -1.
|
| static bool GetAvatarIndex(const std::string& avatar_str,
|
| int* avatar_index);
|
| @@ -64,44 +64,46 @@ class ManagedUserSyncService : public KeyedService,
|
| // It is exposed for testing purposes only.
|
| static std::string BuildAvatarString(int avatar_index);
|
|
|
| - void AddObserver(ManagedUserSyncServiceObserver* observer);
|
| - void RemoveObserver(ManagedUserSyncServiceObserver* observer);
|
| + void AddObserver(SupervisedUserSyncServiceObserver* observer);
|
| + void RemoveObserver(SupervisedUserSyncServiceObserver* observer);
|
|
|
| - void AddManagedUser(const std::string& id,
|
| - const std::string& name,
|
| - const std::string& master_key,
|
| - const std::string& password_signature_key,
|
| - const std::string& password_encryption_key,
|
| - int avatar_index);
|
| - void UpdateManagedUser(const std::string& id,
|
| + void AddSupervisedUser(const std::string& id,
|
| const std::string& name,
|
| const std::string& master_key,
|
| const std::string& signature_key,
|
| const std::string& encryption_key,
|
| int avatar_index);
|
| + void UpdateSupervisedUser(const std::string& id,
|
| + const std::string& name,
|
| + const std::string& master_key,
|
| + const std::string& signature_key,
|
| + const std::string& encryption_key,
|
| + int avatar_index);
|
|
|
| - void DeleteManagedUser(const std::string& id);
|
| + void DeleteSupervisedUser(const std::string& id);
|
|
|
| - // Updates the managed user avatar only if the managed user has
|
| + // Updates the supervised user avatar only if the supervised user has
|
| // no avatar and |avatar_index| is set to some value other than
|
| // |kNoAvatar|. If |avatar_index| equals |kNoAvatar| and the
|
| - // managed user has an avatar, it will be cleared. However,
|
| - // to clear an avatar call the convenience method |ClearManagedUserAvatar()|.
|
| + // supervised user has an avatar, it will be cleared. However,
|
| + // to clear an avatar call the convenience method
|
| + // |ClearSupervisedUserAvatar()|.
|
| // Returns true if the avatar value is changed (either updated or cleared)
|
| // and false otherwise.
|
| - bool UpdateManagedUserAvatarIfNeeded(const std::string& id, int avatar_index);
|
| - void ClearManagedUserAvatar(const std::string& id);
|
| + bool UpdateSupervisedUserAvatarIfNeeded(const std::string& id,
|
| + int avatar_index);
|
| + void ClearSupervisedUserAvatar(const std::string& id);
|
|
|
| - // Returns a dictionary containing all managed users managed by this
|
| + // Returns a dictionary containing all supervised users supervised by this
|
| // custodian. This method should only be called once this service has started
|
| - // syncing managed users (i.e. has finished its initial merge of local and
|
| + // syncing supervised users (i.e. has finished its initial merge of local and
|
| // server-side data, via MergeDataAndStartSyncing), as the stored data might
|
| // be outdated before that.
|
| - const base::DictionaryValue* GetManagedUsers();
|
| + const base::DictionaryValue* GetSupervisedUsers();
|
|
|
| - // Calls the passed |callback| with a dictionary containing all managed users
|
| - // managed by this custodian.
|
| - void GetManagedUsersAsync(const ManagedUsersCallback& callback);
|
| + // Calls the passed |callback| with a dictionary containing all supervised
|
| + // users managed by this custodian.
|
| + void GetSupervisedUsersAsync(const SupervisedUsersCallback& callback);
|
|
|
| // KeyedService implementation:
|
| virtual void Shutdown() OVERRIDE;
|
| @@ -120,11 +122,11 @@ class ManagedUserSyncService : public KeyedService,
|
| const syncer::SyncChangeList& change_list) OVERRIDE;
|
|
|
| private:
|
| - friend class ManagedUserSyncServiceFactory;
|
| + friend class SupervisedUserSyncServiceFactory;
|
|
|
| - // Use |ManagedUserSyncServiceFactory::GetForProfile(...)| to get an
|
| + // Use |SupervisedUserSyncServiceFactory::GetForProfile(...)| to get an
|
| // instance of this service.
|
| - explicit ManagedUserSyncService(PrefService* prefs);
|
| + explicit SupervisedUserSyncService(PrefService* prefs);
|
|
|
| void OnLastSignedInUsernameChange();
|
|
|
| @@ -135,17 +137,17 @@ class ManagedUserSyncService : public KeyedService,
|
| const std::string& encryption_key,
|
| int avatar_index);
|
|
|
| - void UpdateManagedUserImpl(const std::string& id,
|
| - const std::string& name,
|
| - const std::string& master_key,
|
| - const std::string& signature_key,
|
| - const std::string& encryption_key,
|
| - int avatar_index,
|
| - bool add_user);
|
| + void UpdateSupervisedUserImpl(const std::string& id,
|
| + const std::string& name,
|
| + const std::string& master_key,
|
| + const std::string& signature_key,
|
| + const std::string& encryption_key,
|
| + int avatar_index,
|
| + bool add_user);
|
|
|
| - void NotifyManagedUserAcknowledged(const std::string& managed_user_id);
|
| - void NotifyManagedUsersSyncingStopped();
|
| - void NotifyManagedUsersChanged();
|
| + void NotifySupervisedUserAcknowledged(const std::string& supervised_user_id);
|
| + void NotifySupervisedUsersSyncingStopped();
|
| + void NotifySupervisedUsersChanged();
|
|
|
| void DispatchCallbacks();
|
|
|
| @@ -155,11 +157,11 @@ class ManagedUserSyncService : public KeyedService,
|
| scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
|
| scoped_ptr<syncer::SyncErrorFactory> error_handler_;
|
|
|
| - ObserverList<ManagedUserSyncServiceObserver> observers_;
|
| + ObserverList<SupervisedUserSyncServiceObserver> observers_;
|
|
|
| - std::vector<ManagedUsersCallback> callbacks_;
|
| + std::vector<SupervisedUsersCallback> callbacks_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ManagedUserSyncService);
|
| + DISALLOW_COPY_AND_ASSIGN(SupervisedUserSyncService);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SYNC_SERVICE_H_
|
| +#endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SYNC_SERVICE_H_
|
|
|