OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PREF_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
7 | 7 |
8 // A content settings provider that takes its settings out of the pref service. | 8 // A content settings provider that takes its settings out of the pref service. |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 namespace content_settings { | 30 namespace content_settings { |
31 | 31 |
32 // Content settings provider that provides content settings from the user | 32 // Content settings provider that provides content settings from the user |
33 // preference. | 33 // preference. |
34 class PrefProvider : public ObservableProvider { | 34 class PrefProvider : public ObservableProvider { |
35 public: | 35 public: |
36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
37 | 37 |
38 PrefProvider(PrefService* prefs, bool incognito); | 38 PrefProvider(PrefService* prefs, bool incognito); |
39 virtual ~PrefProvider(); | 39 ~PrefProvider() override; |
40 | 40 |
41 // ProviderInterface implementations. | 41 // ProviderInterface implementations. |
42 virtual RuleIterator* GetRuleIterator( | 42 RuleIterator* GetRuleIterator(ContentSettingsType content_type, |
43 ContentSettingsType content_type, | 43 const ResourceIdentifier& resource_identifier, |
44 const ResourceIdentifier& resource_identifier, | 44 bool incognito) const override; |
45 bool incognito) const override; | |
46 | 45 |
47 virtual bool SetWebsiteSetting( | 46 bool SetWebsiteSetting(const ContentSettingsPattern& primary_pattern, |
48 const ContentSettingsPattern& primary_pattern, | 47 const ContentSettingsPattern& secondary_pattern, |
49 const ContentSettingsPattern& secondary_pattern, | 48 ContentSettingsType content_type, |
50 ContentSettingsType content_type, | 49 const ResourceIdentifier& resource_identifier, |
51 const ResourceIdentifier& resource_identifier, | 50 base::Value* value) override; |
52 base::Value* value) override; | |
53 | 51 |
54 virtual void ClearAllContentSettingsRules( | 52 void ClearAllContentSettingsRules(ContentSettingsType content_type) override; |
55 ContentSettingsType content_type) override; | |
56 | 53 |
57 virtual void ShutdownOnUIThread() override; | 54 void ShutdownOnUIThread() override; |
58 | 55 |
59 // Records the last time the given pattern has used a certain content setting. | 56 // Records the last time the given pattern has used a certain content setting. |
60 void UpdateLastUsage(const ContentSettingsPattern& primary_pattern, | 57 void UpdateLastUsage(const ContentSettingsPattern& primary_pattern, |
61 const ContentSettingsPattern& secondary_pattern, | 58 const ContentSettingsPattern& secondary_pattern, |
62 ContentSettingsType content_type); | 59 ContentSettingsType content_type); |
63 | 60 |
64 base::Time GetLastUsage(const ContentSettingsPattern& primary_pattern, | 61 base::Time GetLastUsage(const ContentSettingsPattern& primary_pattern, |
65 const ContentSettingsPattern& secondary_pattern, | 62 const ContentSettingsPattern& secondary_pattern, |
66 ContentSettingsType content_type); | 63 ContentSettingsType content_type); |
67 | 64 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 117 |
121 // Used around accesses to the value map objects to guarantee thread safety. | 118 // Used around accesses to the value map objects to guarantee thread safety. |
122 mutable base::Lock lock_; | 119 mutable base::Lock lock_; |
123 | 120 |
124 DISALLOW_COPY_AND_ASSIGN(PrefProvider); | 121 DISALLOW_COPY_AND_ASSIGN(PrefProvider); |
125 }; | 122 }; |
126 | 123 |
127 } // namespace content_settings | 124 } // namespace content_settings |
128 | 125 |
129 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ | 126 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PREF_PROVIDER_H_ |
OLD | NEW |