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_PREFS_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/linked_ptr.h" | |
15 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
16 #include "base/time/time.h" | 15 #include "base/time/time.h" |
17 #include "base/values.h" | 16 #include "base/values.h" |
18 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
19 #include "components/prefs/scoped_user_pref_update.h" | 18 #include "components/prefs/scoped_user_pref_update.h" |
20 #include "components/sync/api/string_ordinal.h" | 19 #include "components/sync/api/string_ordinal.h" |
21 #include "extensions/browser/blacklist_state.h" | 20 #include "extensions/browser/blacklist_state.h" |
22 #include "extensions/browser/extension_scoped_prefs.h" | 21 #include "extensions/browser/extension_scoped_prefs.h" |
23 #include "extensions/browser/install_flag.h" | 22 #include "extensions/browser/install_flag.h" |
24 #include "extensions/common/constants.h" | 23 #include "extensions/common/constants.h" |
(...skipping 27 matching lines...) Expand all Loading... |
52 // meta-preferences describing properties of the extension like | 51 // meta-preferences describing properties of the extension like |
53 // installation time, whether the extension is enabled, etc. | 52 // installation time, whether the extension is enabled, etc. |
54 // - extension controlled preferences: | 53 // - extension controlled preferences: |
55 // browser preferences that an extension controls. For example, an | 54 // browser preferences that an extension controls. For example, an |
56 // extension could use the proxy API to specify the browser's proxy | 55 // extension could use the proxy API to specify the browser's proxy |
57 // preference. Extension-controlled preferences are stored in | 56 // preference. Extension-controlled preferences are stored in |
58 // PrefValueStore::extension_prefs(), which this class populates and | 57 // PrefValueStore::extension_prefs(), which this class populates and |
59 // maintains as the underlying extensions change. | 58 // maintains as the underlying extensions change. |
60 class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { | 59 class ExtensionPrefs : public ExtensionScopedPrefs, public KeyedService { |
61 public: | 60 public: |
62 typedef std::vector<linked_ptr<ExtensionInfo> > ExtensionsInfo; | 61 using ExtensionsInfo = std::vector<std::unique_ptr<ExtensionInfo>>; |
63 | 62 |
64 // Vector containing identifiers for preferences. | 63 // Vector containing identifiers for preferences. |
65 typedef std::set<std::string> PrefKeySet; | 64 typedef std::set<std::string> PrefKeySet; |
66 | 65 |
67 // This enum is used to store the reason an extension's install has been | 66 // This enum is used to store the reason an extension's install has been |
68 // delayed. Do not remove items or re-order this enum as it is used in | 67 // delayed. Do not remove items or re-order this enum as it is used in |
69 // preferences. | 68 // preferences. |
70 enum DelayReason { | 69 enum DelayReason { |
71 DELAY_REASON_NONE = 0, | 70 DELAY_REASON_NONE = 0, |
72 DELAY_REASON_GC = 1, | 71 DELAY_REASON_GC = 1, |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 bool extensions_disabled_; | 688 bool extensions_disabled_; |
690 | 689 |
691 base::ObserverList<ExtensionPrefsObserver> observer_list_; | 690 base::ObserverList<ExtensionPrefsObserver> observer_list_; |
692 | 691 |
693 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 692 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
694 }; | 693 }; |
695 | 694 |
696 } // namespace extensions | 695 } // namespace extensions |
697 | 696 |
698 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 697 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
OLD | NEW |