OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
9 #include <set> | 10 #include <set> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
16 #include "extensions/browser/extension_prefs_scope.h" | 16 #include "extensions/browser/extension_prefs_scope.h" |
17 | 17 |
18 class PrefValueMap; | 18 class PrefValueMap; |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class Time; | 21 class Time; |
22 class Value; | 22 class Value; |
23 } | 23 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 void RemoveObserver(Observer* observer); | 158 void RemoveObserver(Observer* observer); |
159 | 159 |
160 const base::Value* GetEffectivePrefValue(const std::string& key, | 160 const base::Value* GetEffectivePrefValue(const std::string& key, |
161 bool incognito, | 161 bool incognito, |
162 bool* from_incognito) const; | 162 bool* from_incognito) const; |
163 | 163 |
164 private: | 164 private: |
165 struct ExtensionEntry; | 165 struct ExtensionEntry; |
166 | 166 |
167 typedef std::map<std::string, scoped_ptr<ExtensionEntry>> ExtensionEntryMap; | 167 typedef std::map<std::string, std::unique_ptr<ExtensionEntry>> |
| 168 ExtensionEntryMap; |
168 | 169 |
169 const PrefValueMap* GetExtensionPrefValueMap( | 170 const PrefValueMap* GetExtensionPrefValueMap( |
170 const std::string& ext_id, | 171 const std::string& ext_id, |
171 extensions::ExtensionPrefsScope scope) const; | 172 extensions::ExtensionPrefsScope scope) const; |
172 | 173 |
173 PrefValueMap* GetExtensionPrefValueMap( | 174 PrefValueMap* GetExtensionPrefValueMap( |
174 const std::string& ext_id, | 175 const std::string& ext_id, |
175 extensions::ExtensionPrefsScope scope); | 176 extensions::ExtensionPrefsScope scope); |
176 | 177 |
177 // Returns all keys of pref values that are set by the extension of |entry|, | 178 // Returns all keys of pref values that are set by the extension of |entry|, |
(...skipping 24 matching lines...) Expand all Loading... |
202 // being destroyed. In tests, it isn't called, so the notification must | 203 // being destroyed. In tests, it isn't called, so the notification must |
203 // be done in the destructor. This bit tracks whether it has been done yet. | 204 // be done in the destructor. This bit tracks whether it has been done yet. |
204 bool destroyed_; | 205 bool destroyed_; |
205 | 206 |
206 base::ObserverList<Observer, true> observers_; | 207 base::ObserverList<Observer, true> observers_; |
207 | 208 |
208 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); | 209 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); |
209 }; | 210 }; |
210 | 211 |
211 #endif // EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_ | 212 #endif // EXTENSIONS_BROWSER_EXTENSION_PREF_VALUE_MAP_H_ |
OLD | NEW |