| 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_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_POLICY_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_POLICY_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 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // DefaultContentSettingsProvider implementation. | 35 // DefaultContentSettingsProvider implementation. |
| 36 virtual ContentSetting ProvideDefaultSetting( | 36 virtual ContentSetting ProvideDefaultSetting( |
| 37 ContentSettingsType content_type) const; | 37 ContentSettingsType content_type) const; |
| 38 virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 38 virtual void UpdateDefaultSetting(ContentSettingsType content_type, |
| 39 ContentSetting setting); | 39 ContentSetting setting); |
| 40 virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; | 40 virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; |
| 41 | 41 |
| 42 static void RegisterUserPrefs(PrefService* prefs); | 42 static void RegisterUserPrefs(PrefService* prefs); |
| 43 | 43 |
| 44 // NotificationObserver implementation. | 44 // NotificationObserver implementation. |
| 45 virtual void Observe(NotificationType type, | 45 virtual void Observe(int type, |
| 46 const NotificationSource& source, | 46 const NotificationSource& source, |
| 47 const NotificationDetails& details); | 47 const NotificationDetails& details); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // Informs observers that content settings have changed. Make sure that | 50 // Informs observers that content settings have changed. Make sure that |
| 51 // |lock_| is not held when calling this, as listeners will usually call one | 51 // |lock_| is not held when calling this, as listeners will usually call one |
| 52 // of the GetSettings functions in response, which would then lead to a | 52 // of the GetSettings functions in response, which would then lead to a |
| 53 // mutex deadlock. | 53 // mutex deadlock. |
| 54 void NotifyObservers(const ContentSettingsDetails& details); | 54 void NotifyObservers(const ContentSettingsDetails& details); |
| 55 | 55 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 virtual void GetAllContentSettingsRules( | 107 virtual void GetAllContentSettingsRules( |
| 108 ContentSettingsType content_type, | 108 ContentSettingsType content_type, |
| 109 const ResourceIdentifier& resource_identifier, | 109 const ResourceIdentifier& resource_identifier, |
| 110 Rules* content_setting_rules) const; | 110 Rules* content_setting_rules) const; |
| 111 | 111 |
| 112 virtual void ClearAllContentSettingsRules( | 112 virtual void ClearAllContentSettingsRules( |
| 113 ContentSettingsType content_type); | 113 ContentSettingsType content_type); |
| 114 | 114 |
| 115 // NotificationObserver implementation. | 115 // NotificationObserver implementation. |
| 116 virtual void Observe(NotificationType type, | 116 virtual void Observe(int type, |
| 117 const NotificationSource& source, | 117 const NotificationSource& source, |
| 118 const NotificationDetails& details); | 118 const NotificationDetails& details); |
| 119 private: | 119 private: |
| 120 typedef Tuple5< | 120 typedef Tuple5< |
| 121 ContentSettingsPattern, | 121 ContentSettingsPattern, |
| 122 ContentSettingsPattern, | 122 ContentSettingsPattern, |
| 123 ContentSettingsType, | 123 ContentSettingsType, |
| 124 ResourceIdentifier, | 124 ResourceIdentifier, |
| 125 ContentSetting> ContentSettingsRule; | 125 ContentSetting> ContentSettingsRule; |
| 126 | 126 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 151 // Used around accesses to the content_settings_ object to guarantee | 151 // Used around accesses to the content_settings_ object to guarantee |
| 152 // thread safety. | 152 // thread safety. |
| 153 mutable base::Lock lock_; | 153 mutable base::Lock lock_; |
| 154 | 154 |
| 155 DISALLOW_COPY_AND_ASSIGN(PolicyProvider); | 155 DISALLOW_COPY_AND_ASSIGN(PolicyProvider); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace content_settings | 158 } // namespace content_settings |
| 159 | 159 |
| 160 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_POLICY_PROVIDER_H_ | 160 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_POLICY_PROVIDER_H_ |
| OLD | NEW |