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

Unified Diff: chrome/browser/policy/cloud/user_cloud_policy_store.h

Issue 49783006: policy: Remove SigninManager from UserCloudPolicyStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 1 month 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/policy/cloud/user_cloud_policy_store.h
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store.h b/chrome/browser/policy/cloud/user_cloud_policy_store.h
index b1fcdbe5f9cc31e189ff9b2cbfbbcf67dce15610..43c26c31f0a9331b0785ac19ecdab2a047b1211f 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_store.h
+++ b/chrome/browser/policy/cloud/user_cloud_policy_store.h
@@ -13,8 +13,6 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/policy/cloud/user_cloud_policy_store_base.h"
-class Profile;
-
namespace base {
class SequencedTaskRunner;
}
@@ -26,19 +24,22 @@ namespace policy {
// a secure storage implementation.
class UserCloudPolicyStore : public UserCloudPolicyStoreBase {
public:
- // Creates a policy store associated with the user signed in to this
- // |profile|.
+ // Creates a policy store associated with a signed-in (or in the progress of
+ // it) user.
UserCloudPolicyStore(
- Profile* profile,
const base::FilePath& policy_file,
scoped_refptr<base::SequencedTaskRunner> background_task_runner);
virtual ~UserCloudPolicyStore();
- // Factory method for creating a UserCloudPolicyStore for |profile|.
+ // Factory method for creating a UserCloudPolicyStore for a profile with path
+ // |profile_path|.
static scoped_ptr<UserCloudPolicyStore> Create(
- Profile* profile,
+ const base::FilePath& profile_path,
scoped_refptr<base::SequencedTaskRunner> background_task_runner);
+ // Sets the username from signin for validation of the policy.
+ void SetSigninUsername(const std::string& username);
+
// Loads policy immediately on the current thread. Virtual for mocks.
virtual void LoadImmediately();
@@ -51,6 +52,9 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase {
virtual void Store(
const enterprise_management::PolicyFetchResponse& policy) OVERRIDE;
+ protected:
+ std::string signin_username_;
+
private:
// Callback invoked when a new policy has been loaded from disk. If
// |validate_in_background| is true, then policy is validated via a background
@@ -77,9 +81,6 @@ class UserCloudPolicyStore : public UserCloudPolicyStoreBase {
// WeakPtrFactory used to create callbacks for validating and storing policy.
base::WeakPtrFactory<UserCloudPolicyStore> weak_factory_;
- // Weak pointer to the profile associated with this store.
- Profile* profile_;
-
// Path to file where we store persisted policy.
base::FilePath backing_file_path_;

Powered by Google App Engine
This is Rietveld 408576698