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

Unified Diff: chrome/browser/chromeos/policy/device_local_account_policy_service.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/policy/device_local_account_policy_service.h
diff --git a/chrome/browser/chromeos/policy/device_local_account_policy_service.h b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
index de766394ead77925c9eb29a6438b3099024cc59b..68613e4ff296b9515fbf34bdd8ec01d4997004f9 100644
--- a/chrome/browser/chromeos/policy/device_local_account_policy_service.h
+++ b/chrome/browser/chromeos/policy/device_local_account_policy_service.h
@@ -25,6 +25,7 @@
#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "components/policy/core/common/cloud/component_cloud_policy_service.h"
#include "components/policy/core/common/schema_registry.h"
+#include "components/user_manager/user_id.h"
namespace base {
class SequencedTaskRunner;
@@ -75,7 +76,7 @@ class DeviceLocalAccountPolicyBroker
// For the difference between |account_id| and |user_id|, see the
// documentation of DeviceLocalAccount.
const std::string& account_id() const { return account_id_; }
- const std::string& user_id() const { return user_id_; }
+ const user_manager::UserID& user_id() const { return user_id_; }
scoped_refptr<chromeos::DeviceLocalAccountExternalPolicyLoader>
extension_loader() const { return extension_loader_; }
@@ -123,7 +124,7 @@ class DeviceLocalAccountPolicyBroker
AffiliatedInvalidationServiceProvider* const invalidation_service_provider_;
const std::string account_id_;
- const std::string user_id_;
+ const user_manager::UserID user_id_;
const base::FilePath component_policy_cache_path_;
SchemaRegistry schema_registry_;
const scoped_ptr<DeviceLocalAccountPolicyStore> store_;
@@ -151,7 +152,7 @@ class DeviceLocalAccountPolicyService {
virtual ~Observer() {}
// Policy for the given |user_id| has changed.
- virtual void OnPolicyUpdated(const std::string& user_id) = 0;
+ virtual void OnPolicyUpdated(const user_manager::UserID& user_id) = 0;
// The list of accounts has been updated.
virtual void OnDeviceLocalAccountsChanged() = 0;
@@ -178,17 +179,17 @@ class DeviceLocalAccountPolicyService {
// Get the policy broker for a given |user_id|. Returns NULL if that |user_id|
// does not belong to an existing device-local account.
- DeviceLocalAccountPolicyBroker* GetBrokerForUser(const std::string& user_id);
+ DeviceLocalAccountPolicyBroker* GetBrokerForUser(const user_manager::UserID& user_id);
// Indicates whether policy has been successfully fetched for the given
// |user_id|.
- bool IsPolicyAvailableForUser(const std::string& user_id);
+ bool IsPolicyAvailableForUser(const user_manager::UserID& user_id);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
private:
- typedef std::map<std::string, DeviceLocalAccountPolicyBroker*>
+ typedef std::map<user_manager::UserID, DeviceLocalAccountPolicyBroker*>
PolicyBrokerMap;
// Returns |true| if the directory in which force-installed extensions are
@@ -229,7 +230,7 @@ class DeviceLocalAccountPolicyService {
DeviceLocalAccountPolicyBroker* GetBrokerForStore(CloudPolicyStore* store);
// Notifies the |observers_| that the policy for |user_id| has changed.
- void NotifyPolicyUpdated(const std::string& user_id);
+ void NotifyPolicyUpdated(const user_manager::UserID& user_id);
ObserverList<Observer, true> observers_;

Powered by Google App Engine
This is Rietveld 408576698