| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 class ContentSettingsPref { | 36 class ContentSettingsPref { |
| 37 public: | 37 public: |
| 38 typedef base::Callback<void(const ContentSettingsPattern&, | 38 typedef base::Callback<void(const ContentSettingsPattern&, |
| 39 const ContentSettingsPattern&, | 39 const ContentSettingsPattern&, |
| 40 ContentSettingsType, | 40 ContentSettingsType, |
| 41 const std::string&)> NotifyObserversCallback; | 41 const std::string&)> NotifyObserversCallback; |
| 42 | 42 |
| 43 ContentSettingsPref(ContentSettingsType content_type, | 43 ContentSettingsPref(ContentSettingsType content_type, |
| 44 PrefService* prefs, | 44 PrefService* prefs, |
| 45 PrefChangeRegistrar* registrar, | 45 PrefChangeRegistrar* registrar, |
| 46 const char* pref_name, | 46 const std::string& pref_name, |
| 47 bool incognito, | 47 bool incognito, |
| 48 NotifyObserversCallback notify_callback); | 48 NotifyObserversCallback notify_callback); |
| 49 ~ContentSettingsPref(); | 49 ~ContentSettingsPref(); |
| 50 | 50 |
| 51 RuleIterator* GetRuleIterator(const ResourceIdentifier& resource_identifier, | 51 RuleIterator* GetRuleIterator(const ResourceIdentifier& resource_identifier, |
| 52 bool incognito) const; | 52 bool incognito) const; |
| 53 | 53 |
| 54 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, | 54 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, |
| 55 const ContentSettingsPattern& secondary_pattern, | 55 const ContentSettingsPattern& secondary_pattern, |
| 56 const ResourceIdentifier& resource_identifier, | 56 const ResourceIdentifier& resource_identifier, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // The type of content settings stored in this pref. | 99 // The type of content settings stored in this pref. |
| 100 ContentSettingsType content_type_; | 100 ContentSettingsType content_type_; |
| 101 | 101 |
| 102 // Weak; owned by the Profile and reset in ShutdownOnUIThread. | 102 // Weak; owned by the Profile and reset in ShutdownOnUIThread. |
| 103 PrefService* prefs_; | 103 PrefService* prefs_; |
| 104 | 104 |
| 105 // Owned by the PrefProvider. | 105 // Owned by the PrefProvider. |
| 106 PrefChangeRegistrar* registrar_; | 106 PrefChangeRegistrar* registrar_; |
| 107 | 107 |
| 108 // Name of the dictionary preference managed by this class. | 108 // Name of the dictionary preference managed by this class. |
| 109 const char* pref_name_; | 109 const std::string& pref_name_; |
| 110 | 110 |
| 111 bool is_incognito_; | 111 bool is_incognito_; |
| 112 | 112 |
| 113 // Whether we are currently updating preferences, this is used to ignore | 113 // Whether we are currently updating preferences, this is used to ignore |
| 114 // notifications from the preferences service that we triggered ourself. | 114 // notifications from the preferences service that we triggered ourself. |
| 115 bool updating_preferences_; | 115 bool updating_preferences_; |
| 116 | 116 |
| 117 OriginIdentifierValueMap value_map_; | 117 OriginIdentifierValueMap value_map_; |
| 118 | 118 |
| 119 OriginIdentifierValueMap incognito_value_map_; | 119 OriginIdentifierValueMap incognito_value_map_; |
| 120 | 120 |
| 121 NotifyObserversCallback notify_callback_; | 121 NotifyObserversCallback notify_callback_; |
| 122 | 122 |
| 123 // Used around accesses to the value map objects to guarantee thread safety. | 123 // Used around accesses to the value map objects to guarantee thread safety. |
| 124 mutable base::Lock lock_; | 124 mutable base::Lock lock_; |
| 125 | 125 |
| 126 base::ThreadChecker thread_checker_; | 126 base::ThreadChecker thread_checker_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(ContentSettingsPref); | 128 DISALLOW_COPY_AND_ASSIGN(ContentSettingsPref); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace content_settings | 131 } // namespace content_settings |
| 132 | 132 |
| 133 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_ | 133 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_PREF_H_ |
| OLD | NEW |