| 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 // Interface for objects providing content setting rules. | 5 // Interface for objects providing content setting rules. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 virtual void ShutdownOnUIThread() = 0; | 47 virtual void ShutdownOnUIThread() = 0; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class ProviderInterface { | 50 class ProviderInterface { |
| 51 public: | 51 public: |
| 52 struct Rule { | 52 struct Rule { |
| 53 Rule(); | 53 Rule(); |
| 54 Rule(const ContentSettingsPattern& primary_pattern, | 54 Rule(const ContentSettingsPattern& primary_pattern, |
| 55 const ContentSettingsPattern& secondary_pattern, | 55 const ContentSettingsPattern& secondary_pattern, |
| 56 ContentSetting setting); | 56 ContentSetting setting); |
| 57 bool operator<(const Rule& rhs) const; |
| 57 | 58 |
| 58 ContentSettingsPattern primary_pattern; | 59 ContentSettingsPattern primary_pattern; |
| 59 ContentSettingsPattern secondary_pattern; | 60 ContentSettingsPattern secondary_pattern; |
| 60 ContentSetting content_setting; | 61 ContentSetting content_setting; |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 typedef std::vector<Rule> Rules; | 64 typedef std::vector<Rule> Rules; |
| 64 | 65 |
| 65 virtual ~ProviderInterface() {} | 66 virtual ~ProviderInterface() {} |
| 66 | 67 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Detaches the Provider from all Profile-related objects like PrefService. | 133 // Detaches the Provider from all Profile-related objects like PrefService. |
| 133 // This methods needs to be called before destroying the Profile. | 134 // This methods needs to be called before destroying the Profile. |
| 134 // Afterwards, none of the methods above that should only be called on the UI | 135 // Afterwards, none of the methods above that should only be called on the UI |
| 135 // thread should be called anymore. | 136 // thread should be called anymore. |
| 136 virtual void ShutdownOnUIThread() = 0; | 137 virtual void ShutdownOnUIThread() = 0; |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } // namespace content_settings | 140 } // namespace content_settings |
| 140 | 141 |
| 141 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 142 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |
| OLD | NEW |