OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PREFS_PREF_NOTIFIER_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ |
6 #define CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
13 #include "base/non_thread_safe.h" | 13 #include "base/non_thread_safe.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
16 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
17 | 17 |
18 class NotificationObserver; | 18 class NotificationObserver; |
19 class PrefService; | 19 class PrefService; |
20 class PrefValueStore; | 20 class PrefValueStore; |
21 class Value; | 21 class Value; |
22 | 22 |
23 // Registers observers for particular preferences and sends notifications when | 23 // Registers observers for particular preferences and sends notifications when |
24 // preference values or sources (i.e., which preference layer controls the | 24 // preference values or sources (i.e., which preference layer controls the |
25 // preference) change. | 25 // preference) change. |
26 class PrefNotifier : public NonThreadSafe, | 26 class PrefNotifier : public NonThreadSafe, |
27 public NotificationObserver { | 27 public NotificationObserver { |
28 public: | 28 public: |
29 // PrefStores must be listed here in order from highest to lowest priority. | 29 // PrefStores must be listed here in order from highest to lowest priority. |
30 // MANAGED contains all managed (policy) preference values. | 30 // MANAGED_PLATFORM contains all managed preference values that are |
| 31 // provided by a platform-specific policy mechanism (e.g. Windows |
| 32 // Group Policy). |
| 33 // DEVICE_MANAGEMENT contains all managed preference values supplied |
| 34 // by the device management server (cloud policy). |
31 // EXTENSION contains preference values set by extensions. | 35 // EXTENSION contains preference values set by extensions. |
32 // COMMAND_LINE contains preference values set by command-line switches. | 36 // COMMAND_LINE contains preference values set by command-line switches. |
33 // USER contains all user-set preference values. | 37 // USER contains all user-set preference values. |
34 // RECOMMENDED contains all recommended (policy) preference values. | 38 // RECOMMENDED contains all recommended (policy) preference values. |
35 // DEFAULT contains all application default preference values. | 39 // DEFAULT contains all application default preference values. |
36 // This enum is kept in pref_notifier.h rather than pref_value_store.h in | 40 // This enum is kept in pref_notifier.h rather than pref_value_store.h in |
37 // order to minimize additional headers needed by the *PrefStore files. | 41 // order to minimize additional headers needed by the *PrefStore files. |
38 enum PrefStoreType { | 42 enum PrefStoreType { |
39 // INVALID_STORE is not associated with an actual PrefStore but used as | 43 // INVALID_STORE is not associated with an actual PrefStore but used as |
40 // an invalid marker, e.g. as a return value. | 44 // an invalid marker, e.g. as a return value. |
41 INVALID_STORE = -1, | 45 INVALID_STORE = -1, |
42 MANAGED_STORE = 0, | 46 MANAGED_PLATFORM_STORE = 0, |
| 47 DEVICE_MANAGEMENT_STORE, |
43 EXTENSION_STORE, | 48 EXTENSION_STORE, |
44 COMMAND_LINE_STORE, | 49 COMMAND_LINE_STORE, |
45 USER_STORE, | 50 USER_STORE, |
46 RECOMMENDED_STORE, | 51 RECOMMENDED_STORE, |
47 DEFAULT_STORE, | 52 DEFAULT_STORE, |
48 PREF_STORE_TYPE_MAX = DEFAULT_STORE | 53 PREF_STORE_TYPE_MAX = DEFAULT_STORE |
49 }; | 54 }; |
50 | 55 |
51 // The |service| with which this notifier is associated will be sent as the | 56 // The |service| with which this notifier is associated will be sent as the |
52 // source of any notifications. | 57 // source of any notifications. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 109 |
105 // NotificationObserver methods: | 110 // NotificationObserver methods: |
106 virtual void Observe(NotificationType type, | 111 virtual void Observe(NotificationType type, |
107 const NotificationSource& source, | 112 const NotificationSource& source, |
108 const NotificationDetails& details); | 113 const NotificationDetails& details); |
109 | 114 |
110 DISALLOW_COPY_AND_ASSIGN(PrefNotifier); | 115 DISALLOW_COPY_AND_ASSIGN(PrefNotifier); |
111 }; | 116 }; |
112 | 117 |
113 #endif // CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ | 118 #endif // CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ |
OLD | NEW |