OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // PolicyService::Observer implementation: | 61 // PolicyService::Observer implementation: |
62 void OnPolicyServiceInitialized(policy::PolicyDomain domain) override; | 62 void OnPolicyServiceInitialized(policy::PolicyDomain domain) override; |
63 void OnPolicyUpdated(const policy::PolicyNamespace& ns, | 63 void OnPolicyUpdated(const policy::PolicyNamespace& ns, |
64 const policy::PolicyMap& previous, | 64 const policy::PolicyMap& previous, |
65 const policy::PolicyMap& current) override; | 65 const policy::PolicyMap& current) override; |
66 | 66 |
67 // Returns the policy domain that should be used for the specified profile. | 67 // Returns the policy domain that should be used for the specified profile. |
68 static policy::PolicyDomain GetPolicyDomain(Profile* profile); | 68 static policy::PolicyDomain GetPolicyDomain(Profile* profile); |
69 | 69 |
70 // Posted by OnPolicyUpdated() to update a PolicyValueStore on the FILE | 70 // Posted by OnPolicyUpdated() to update a PolicyValueStore on the backend |
71 // thread. | 71 // sequence. |
72 void UpdatePolicyOnFILE(const std::string& extension_id, | 72 void UpdatePolicyOnBackend(const std::string& extension_id, |
73 std::unique_ptr<policy::PolicyMap> current_policy); | 73 std::unique_ptr<policy::PolicyMap> current_policy); |
74 | 74 |
75 // Returns an existing PolicyValueStore for |extension_id|, or NULL. | 75 // Returns an existing PolicyValueStore for |extension_id|, or NULL. |
76 PolicyValueStore* GetStoreFor(const std::string& extension_id); | 76 PolicyValueStore* GetStoreFor(const std::string& extension_id); |
77 | 77 |
78 // Returns true if a backing store has been created for |extension_id|. | 78 // Returns true if a backing store has been created for |extension_id|. |
79 bool HasStore(const std::string& extension_id) const; | 79 bool HasStore(const std::string& extension_id) const; |
80 | 80 |
81 // The profile that owns the extension system being used. This is used to | 81 // The profile that owns the extension system being used. This is used to |
82 // get the PolicyService, the EventRouter and the ExtensionService. | 82 // get the PolicyService, the EventRouter and the ExtensionService. |
83 Profile* profile_; | 83 Profile* profile_; |
(...skipping 16 matching lines...) Expand all Loading... |
100 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be | 100 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be |
101 // accessed only on the FILE thread as well. | 101 // accessed only on the FILE thread as well. |
102 std::map<std::string, std::unique_ptr<PolicyValueStore>> store_map_; | 102 std::map<std::string, std::unique_ptr<PolicyValueStore>> store_map_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); | 104 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace extensions | 107 } // namespace extensions |
108 | 108 |
109 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 109 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
OLD | NEW |