| 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_POLICY_CONTENT_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_POLICY_CONTENT_SETTINGS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_POLICY_CONTENT_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_POLICY_CONTENT_SETTINGS_PROVIDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 // A content settings provider that takes its settings out of policies. | 9 // A content settings provider that takes its settings out of policies. |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "chrome/browser/content_settings/content_settings_provider.h" | 13 #include "chrome/browser/content_settings/content_settings_provider.h" |
| 14 #include "chrome/browser/prefs/pref_change_registrar.h" | 14 #include "chrome/browser/prefs/pref_change_registrar.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 ContentSettingsDetails; | 18 class ContentSettingsDetails; |
| 19 class DictionaryValue; | 19 class DictionaryValue; |
| 20 class PrefService; | 20 class PrefService; |
| 21 class Profile; | 21 class Profile; |
| 22 | 22 |
| 23 class PolicyContentSettingsProvider : public DefaultContentSettingsProvider, | 23 namespace content_settings { |
| 24 public NotificationObserver { | 24 |
| 25 class PolicyDefaultContentSettingsProvider |
| 26 : public DefaultContentSettingsProviderInterface, |
| 27 public NotificationObserver { |
| 25 public: | 28 public: |
| 26 explicit PolicyContentSettingsProvider(Profile* profile); | 29 explicit PolicyDefaultContentSettingsProvider(Profile* profile); |
| 27 virtual ~PolicyContentSettingsProvider(); | 30 virtual ~PolicyDefaultContentSettingsProvider(); |
| 28 | 31 |
| 29 // DefaultContentSettingsProvider implementation. | 32 // DefaultContentSettingsProviderInterface implementation. |
| 30 virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const; | 33 virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const; |
| 31 virtual ContentSetting ProvideDefaultSetting( | 34 virtual ContentSetting ProvideDefaultSetting( |
| 32 ContentSettingsType content_type) const; | 35 ContentSettingsType content_type) const; |
| 33 virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 36 virtual void UpdateDefaultSetting(ContentSettingsType content_type, |
| 34 ContentSetting setting); | 37 ContentSetting setting); |
| 35 virtual void ResetToDefaults(); | 38 virtual void ResetToDefaults(); |
| 36 virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; | 39 virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; |
| 37 | 40 |
| 38 static void RegisterUserPrefs(PrefService* prefs); | 41 static void RegisterUserPrefs(PrefService* prefs); |
| 39 | 42 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 65 // Whether this settings map is for an OTR session. | 68 // Whether this settings map is for an OTR session. |
| 66 bool is_off_the_record_; | 69 bool is_off_the_record_; |
| 67 | 70 |
| 68 // Used around accesses to the managed_default_content_settings_ object to | 71 // Used around accesses to the managed_default_content_settings_ object to |
| 69 // guarantee thread safety. | 72 // guarantee thread safety. |
| 70 mutable base::Lock lock_; | 73 mutable base::Lock lock_; |
| 71 | 74 |
| 72 PrefChangeRegistrar pref_change_registrar_; | 75 PrefChangeRegistrar pref_change_registrar_; |
| 73 NotificationRegistrar notification_registrar_; | 76 NotificationRegistrar notification_registrar_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(PolicyContentSettingsProvider); | 78 DISALLOW_COPY_AND_ASSIGN(PolicyDefaultContentSettingsProvider); |
| 76 }; | 79 }; |
| 77 | 80 |
| 81 } // namespace content_settings |
| 82 |
| 78 #endif // CHROME_BROWSER_CONTENT_SETTINGS_POLICY_CONTENT_SETTINGS_PROVIDER_H_ | 83 #endif // CHROME_BROWSER_CONTENT_SETTINGS_POLICY_CONTENT_SETTINGS_PROVIDER_H_ |
| OLD | NEW |