| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DEFAULT_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_DEFAULT_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_DEFAULT_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_DEFAULT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/prefs/public/pref_change_registrar.h" | 14 #include "base/prefs/public/pref_change_registrar.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "chrome/browser/content_settings/content_settings_observable_provider.h
" | 16 #include "chrome/browser/content_settings/content_settings_observable_provider.h
" |
| 17 | 17 |
| 18 class PrefService; | 18 class PrefService; |
| 19 class PrefServiceSyncable; |
| 19 | 20 |
| 20 namespace content_settings { | 21 namespace content_settings { |
| 21 | 22 |
| 22 // Provider that provides default content settings based on | 23 // Provider that provides default content settings based on |
| 23 // user prefs. If no default values are set by the user we use the hard coded | 24 // user prefs. If no default values are set by the user we use the hard coded |
| 24 // default values. | 25 // default values. |
| 25 class DefaultProvider : public ObservableProvider { | 26 class DefaultProvider : public ObservableProvider { |
| 26 public: | 27 public: |
| 27 static void RegisterUserPrefs(PrefService* prefs); | 28 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 28 | 29 |
| 29 DefaultProvider(PrefService* prefs, | 30 DefaultProvider(PrefService* prefs, |
| 30 bool incognito); | 31 bool incognito); |
| 31 virtual ~DefaultProvider(); | 32 virtual ~DefaultProvider(); |
| 32 | 33 |
| 33 // ProviderInterface implementations. | 34 // ProviderInterface implementations. |
| 34 virtual RuleIterator* GetRuleIterator( | 35 virtual RuleIterator* GetRuleIterator( |
| 35 ContentSettingsType content_type, | 36 ContentSettingsType content_type, |
| 36 const ResourceIdentifier& resource_identifier, | 37 const ResourceIdentifier& resource_identifier, |
| 37 bool incognito) const OVERRIDE; | 38 bool incognito) const OVERRIDE; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Whether we are currently updating preferences, this is used to ignore | 83 // Whether we are currently updating preferences, this is used to ignore |
| 83 // notifications from the preferences service that we triggered ourself. | 84 // notifications from the preferences service that we triggered ourself. |
| 84 bool updating_preferences_; | 85 bool updating_preferences_; |
| 85 | 86 |
| 86 DISALLOW_COPY_AND_ASSIGN(DefaultProvider); | 87 DISALLOW_COPY_AND_ASSIGN(DefaultProvider); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 } // namespace content_settings | 90 } // namespace content_settings |
| 90 | 91 |
| 91 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_DEFAULT_PROVIDER_H_ | 92 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_DEFAULT_PROVIDER_H_ |
| OLD | NEW |