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_MOCK_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool is_managed); | 28 bool is_managed); |
29 virtual ~MockProvider(); | 29 virtual ~MockProvider(); |
30 | 30 |
31 virtual RuleIterator* GetRuleIterator( | 31 virtual RuleIterator* GetRuleIterator( |
32 ContentSettingsType content_type, | 32 ContentSettingsType content_type, |
33 const ResourceIdentifier& resource_identifier, | 33 const ResourceIdentifier& resource_identifier, |
34 bool incognito) const OVERRIDE; | 34 bool incognito) const OVERRIDE; |
35 | 35 |
36 // The MockProvider is only able to store one content setting. So every time | 36 // The MockProvider is only able to store one content setting. So every time |
37 // this method is called the previously set content settings is overwritten. | 37 // this method is called the previously set content settings is overwritten. |
38 virtual void SetContentSetting( | 38 virtual bool SetWebsiteSetting( |
39 const ContentSettingsPattern& requesting_url_pattern, | 39 const ContentSettingsPattern& requesting_url_pattern, |
40 const ContentSettingsPattern& embedding_url_pattern, | 40 const ContentSettingsPattern& embedding_url_pattern, |
41 ContentSettingsType content_type, | 41 ContentSettingsType content_type, |
42 const ResourceIdentifier& resource_identifier, | 42 const ResourceIdentifier& resource_identifier, |
43 ContentSetting content_setting) OVERRIDE; | 43 base::Value* value) OVERRIDE; |
44 | 44 |
45 virtual void ClearAllContentSettingsRules( | 45 virtual void ClearAllContentSettingsRules( |
46 ContentSettingsType content_type) OVERRIDE {} | 46 ContentSettingsType content_type) OVERRIDE {} |
47 | 47 |
48 virtual void ShutdownOnUIThread() OVERRIDE; | 48 virtual void ShutdownOnUIThread() OVERRIDE; |
49 | 49 |
50 void set_read_only(bool read_only) { | 50 void set_read_only(bool read_only) { |
51 read_only_ = read_only; | 51 read_only_ = read_only; |
52 } | 52 } |
53 | 53 |
54 bool read_only() const { | 54 bool read_only() const { |
55 return read_only_; | 55 return read_only_; |
56 } | 56 } |
57 | 57 |
58 private: | 58 private: |
59 OriginIdentifierValueMap value_map_; | 59 OriginIdentifierValueMap value_map_; |
60 bool read_only_; | 60 bool read_only_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(MockProvider); | 62 DISALLOW_COPY_AND_ASSIGN(MockProvider); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace content_settings | 65 } // namespace content_settings |
66 | 66 |
67 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ | 67 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ |
OLD | NEW |