| 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 <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const policy::PolicyMap& current) OVERRIDE; | 65 const policy::PolicyMap& current) OVERRIDE; |
| 66 | 66 |
| 67 // Posted by OnPolicyUpdated() to update a PolicyValueStore on the FILE | 67 // Posted by OnPolicyUpdated() to update a PolicyValueStore on the FILE |
| 68 // thread. | 68 // thread. |
| 69 void UpdatePolicyOnFILE(const std::string& extension_id, | 69 void UpdatePolicyOnFILE(const std::string& extension_id, |
| 70 scoped_ptr<policy::PolicyMap> current_policy); | 70 scoped_ptr<policy::PolicyMap> current_policy); |
| 71 | 71 |
| 72 // Returns an existing PolicyValueStore for |extension_id|, or NULL. | 72 // Returns an existing PolicyValueStore for |extension_id|, or NULL. |
| 73 PolicyValueStore* GetStoreFor(const std::string& extension_id); | 73 PolicyValueStore* GetStoreFor(const std::string& extension_id); |
| 74 | 74 |
| 75 // Returns true if a backing store has been created for |extension_id|. |
| 76 bool HasStore(const std::string& extension_id) const; |
| 77 |
| 75 // The profile that owns the extension system being used. This is used to | 78 // The profile that owns the extension system being used. This is used to |
| 76 // get the PolicyService, the EventRouter and the ExtensionService. | 79 // get the PolicyService, the EventRouter and the ExtensionService. |
| 77 Profile* profile_; | 80 Profile* profile_; |
| 78 | 81 |
| 79 // The |profile_|'s PolicyService. | 82 // The |profile_|'s PolicyService. |
| 80 policy::PolicyService* policy_service_; | 83 policy::PolicyService* policy_service_; |
| 81 | 84 |
| 82 // Observes extension loading and unloading, and keeps the Profile's | 85 // Observes extension loading and unloading, and keeps the Profile's |
| 83 // PolicyService aware of the current list of extensions. | 86 // PolicyService aware of the current list of extensions. |
| 84 scoped_ptr<ExtensionTracker> extension_tracker_; | 87 scoped_ptr<ExtensionTracker> extension_tracker_; |
| 85 | 88 |
| 86 // These live on the FILE thread. | 89 // These live on the FILE thread. |
| 87 scoped_refptr<SettingsStorageFactory> storage_factory_; | 90 scoped_refptr<SettingsStorageFactory> storage_factory_; |
| 88 scoped_refptr<SettingsObserverList> observers_; | 91 scoped_refptr<SettingsObserverList> observers_; |
| 89 base::FilePath base_path_; | 92 base::FilePath base_path_; |
| 90 | 93 |
| 91 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be | 94 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be |
| 92 // accessed only on the FILE thread as well. | 95 // accessed only on the FILE thread as well. |
| 93 PolicyValueStoreMap store_map_; | 96 PolicyValueStoreMap store_map_; |
| 94 | 97 |
| 95 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); | 98 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 } // namespace extensions | 101 } // namespace extensions |
| 99 | 102 |
| 100 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 103 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
| OLD | NEW |