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_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
7 | 7 |
8 // A content settings provider that takes its settings out of the pref service. | 8 // A content settings provider that takes its settings out of the pref service. |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/prefs/public/pref_change_registrar.h" | 13 #include "base/prefs/public/pref_change_registrar.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "chrome/browser/content_settings/content_settings_observable_provider.h
" | 15 #include "chrome/browser/content_settings/content_settings_observable_provider.h
" |
16 #include "chrome/browser/content_settings/content_settings_origin_identifier_val
ue_map.h" | 16 #include "chrome/browser/content_settings/content_settings_origin_identifier_val
ue_map.h" |
17 #include "chrome/browser/content_settings/content_settings_utils.h" | 17 #include "chrome/browser/content_settings/content_settings_utils.h" |
18 | 18 |
19 class PrefService; | 19 class PrefService; |
| 20 class PrefServiceSyncable; |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class DictionaryValue; | 23 class DictionaryValue; |
23 } | 24 } |
24 | 25 |
25 namespace content_settings { | 26 namespace content_settings { |
26 | 27 |
27 // Content settings provider that provides content settings from the user | 28 // Content settings provider that provides content settings from the user |
28 // preference. | 29 // preference. |
29 class PrefProvider : public ObservableProvider { | 30 class PrefProvider : public ObservableProvider { |
30 public: | 31 public: |
31 static void RegisterUserPrefs(PrefService* prefs); | 32 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
32 | 33 |
33 PrefProvider(PrefService* prefs, | 34 PrefProvider(PrefService* prefs, bool incognito); |
34 bool incognito); | |
35 virtual ~PrefProvider(); | 35 virtual ~PrefProvider(); |
36 | 36 |
37 // ProviderInterface implementations. | 37 // ProviderInterface implementations. |
38 virtual RuleIterator* GetRuleIterator( | 38 virtual RuleIterator* GetRuleIterator( |
39 ContentSettingsType content_type, | 39 ContentSettingsType content_type, |
40 const ResourceIdentifier& resource_identifier, | 40 const ResourceIdentifier& resource_identifier, |
41 bool incognito) const OVERRIDE; | 41 bool incognito) const OVERRIDE; |
42 | 42 |
43 virtual bool SetWebsiteSetting( | 43 virtual bool SetWebsiteSetting( |
44 const ContentSettingsPattern& primary_pattern, | 44 const ContentSettingsPattern& primary_pattern, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 // Used around accesses to the value map objects to guarantee thread safety. | 102 // Used around accesses to the value map objects to guarantee thread safety. |
103 mutable base::Lock lock_; | 103 mutable base::Lock lock_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(PrefProvider); | 105 DISALLOW_COPY_AND_ASSIGN(PrefProvider); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace content_settings | 108 } // namespace content_settings |
109 | 109 |
110 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ | 110 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
OLD | NEW |