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

Side by Side Diff: chrome/browser/extensions/api/storage/policy_value_store.h

Issue 60823003: Introduced a ForwardingPolicyProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fixes 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_POLICY_VALUE_STORE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_POLICY_VALUE_STORE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_POLICY_VALUE_STORE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_POLICY_VALUE_STORE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 15 matching lines...) Expand all
26 // extension. The ManagedValueStoreCache sends updated policy to this store 26 // extension. The ManagedValueStoreCache sends updated policy to this store
27 // and manages its lifetime. 27 // and manages its lifetime.
28 class PolicyValueStore : public ValueStore { 28 class PolicyValueStore : public ValueStore {
29 public: 29 public:
30 PolicyValueStore(const std::string& extension_id, 30 PolicyValueStore(const std::string& extension_id,
31 const scoped_refptr<SettingsObserverList>& observers, 31 const scoped_refptr<SettingsObserverList>& observers,
32 scoped_ptr<ValueStore> delegate); 32 scoped_ptr<ValueStore> delegate);
33 virtual ~PolicyValueStore(); 33 virtual ~PolicyValueStore();
34 34
35 // Stores |policy| in the persistent database represented by the |delegate_|. 35 // Stores |policy| in the persistent database represented by the |delegate_|.
36 // If |notify_if_changed| and |policy| differs from the previously persisted 36 void SetCurrentPolicy(const policy::PolicyMap& policy);
bartfab (slow) 2013/11/11 14:40:08 Nit: |notify_if_changed| no longer exists but the
Joao da Silva 2013/11/12 15:26:33 Done.
37 // version, then a notification is sent to the |observers_| with a list of the
38 // changes detected.
39 void SetCurrentPolicy(const policy::PolicyMap& policy,
40 bool notify_if_changed);
41 37
42 // Clears all the stored data and deletes the database. 38 // Clears all the stored data and deletes the database.
43 void DeleteStorage(); 39 void DeleteStorage();
44 40
45 // ValueStore implementation: 41 // ValueStore implementation:
46 virtual size_t GetBytesInUse(const std::string& key) OVERRIDE; 42 virtual size_t GetBytesInUse(const std::string& key) OVERRIDE;
47 virtual size_t GetBytesInUse(const std::vector<std::string>& keys) OVERRIDE; 43 virtual size_t GetBytesInUse(const std::vector<std::string>& keys) OVERRIDE;
48 virtual size_t GetBytesInUse() OVERRIDE; 44 virtual size_t GetBytesInUse() OVERRIDE;
49 virtual ReadResult Get(const std::string& key) OVERRIDE; 45 virtual ReadResult Get(const std::string& key) OVERRIDE;
50 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; 46 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE;
(...skipping 15 matching lines...) Expand all
66 std::string extension_id_; 62 std::string extension_id_;
67 scoped_refptr<SettingsObserverList> observers_; 63 scoped_refptr<SettingsObserverList> observers_;
68 scoped_ptr<ValueStore> delegate_; 64 scoped_ptr<ValueStore> delegate_;
69 65
70 DISALLOW_COPY_AND_ASSIGN(PolicyValueStore); 66 DISALLOW_COPY_AND_ASSIGN(PolicyValueStore);
71 }; 67 };
72 68
73 } // namespace extensions 69 } // namespace extensions
74 70
75 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_POLICY_VALUE_STORE_H_ 71 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_POLICY_VALUE_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698