| 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/pref_change_registrar.h" | 13 #include "base/prefs/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 PrefRegistrySyncable; | |
| 21 | 20 |
| 22 namespace base { | 21 namespace base { |
| 23 class DictionaryValue; | 22 class DictionaryValue; |
| 24 } | 23 } |
| 25 | 24 |
| 25 namespace user_prefs { |
| 26 class PrefRegistrySyncable; |
| 27 } |
| 28 |
| 26 namespace content_settings { | 29 namespace content_settings { |
| 27 | 30 |
| 28 // Content settings provider that provides content settings from the user | 31 // Content settings provider that provides content settings from the user |
| 29 // preference. | 32 // preference. |
| 30 class PrefProvider : public ObservableProvider { | 33 class PrefProvider : public ObservableProvider { |
| 31 public: | 34 public: |
| 32 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 35 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 33 | 36 |
| 34 PrefProvider(PrefService* prefs, bool incognito); | 37 PrefProvider(PrefService* prefs, bool incognito); |
| 35 virtual ~PrefProvider(); | 38 virtual ~PrefProvider(); |
| 36 | 39 |
| 37 // ProviderInterface implementations. | 40 // ProviderInterface implementations. |
| 38 virtual RuleIterator* GetRuleIterator( | 41 virtual RuleIterator* GetRuleIterator( |
| 39 ContentSettingsType content_type, | 42 ContentSettingsType content_type, |
| 40 const ResourceIdentifier& resource_identifier, | 43 const ResourceIdentifier& resource_identifier, |
| 41 bool incognito) const OVERRIDE; | 44 bool incognito) const OVERRIDE; |
| 42 | 45 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 104 |
| 102 // Used around accesses to the value map objects to guarantee thread safety. | 105 // Used around accesses to the value map objects to guarantee thread safety. |
| 103 mutable base::Lock lock_; | 106 mutable base::Lock lock_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(PrefProvider); | 108 DISALLOW_COPY_AND_ASSIGN(PrefProvider); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 } // namespace content_settings | 111 } // namespace content_settings |
| 109 | 112 |
| 110 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ | 113 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
| OLD | NEW |