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

Side by Side Diff: chrome/browser/policy/user_cloud_policy_store.h

Issue 10693022: Add support for loading user cloud policy on desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed redundant #ifdef OS_CHROMEOS guard Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_
6 #define CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/policy/user_cloud_policy_store_base.h"
14
15 namespace policy {
16
17 // Implements a cloud policy store that is stored in a simple file in the user's
18 // profile directory. This is used on (non-chromeos) platforms that do not have
19 // a secure storage implementation.
20 class UserCloudPolicyStore : public UserCloudPolicyStoreBase {
21 public:
22 // Creates a policy store associated with the user signed in to this
23 // |profile|.
24 explicit UserCloudPolicyStore(Profile* profile);
25 virtual ~UserCloudPolicyStore();
26
27 // CloudPolicyStore implementation.
28 virtual void Load() OVERRIDE;
29 virtual void Store(
30 const enterprise_management::PolicyFetchResponse& policy) OVERRIDE;
31
32 private:
33 // Starts policy blob validation. |callback| is invoked once validation is
34 // complete.
35 void Validate(
36 scoped_ptr<enterprise_management::PolicyFetchResponse> policy,
37 const UserCloudPolicyValidator::CompletionCallback& callback);
38
39 // Callback invoked to store the policy after validation has finished.
40 void StorePolicyAfterValidation(UserCloudPolicyValidator* validator);
41
42 base::WeakPtrFactory<UserCloudPolicyStore> weak_factory_;
43
44 // Weak pointer to the profile associated with this store.
45 Profile* profile_;
46
47 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyStore);
48 };
49
50 } // namespace policy
51
52 #endif // CHROME_BROWSER_POLICY_USER_CLOUD_POLICY_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698