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 #include "chrome/browser/content_settings/content_settings_mock_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_mock_provider.h" |
6 | 6 |
7 namespace content_settings { | 7 namespace content_settings { |
8 | 8 |
9 MockProvider::MockProvider() | 9 MockProvider::MockProvider() |
10 : read_only_(false) {} | 10 : read_only_(false) {} |
11 | 11 |
12 MockProvider::MockProvider(ContentSettingsPattern requesting_url_pattern, | 12 MockProvider::MockProvider(bool read_only) |
13 ContentSettingsPattern embedding_url_pattern, | |
14 ContentSettingsType content_type, | |
15 ResourceIdentifier resource_identifier, | |
16 ContentSetting setting, | |
17 bool read_only, | |
18 bool is_managed) | |
19 : read_only_(read_only) { | 13 : read_only_(read_only) { |
20 value_map_.SetValue(requesting_url_pattern, | |
21 embedding_url_pattern, | |
22 content_type, | |
23 resource_identifier, | |
24 Value::CreateIntegerValue(setting)); | |
25 } | 14 } |
26 | 15 |
27 MockProvider::~MockProvider() {} | 16 MockProvider::~MockProvider() {} |
28 | 17 |
29 RuleIterator* MockProvider::GetRuleIterator( | 18 RuleIterator* MockProvider::GetRuleIterator( |
30 ContentSettingsType content_type, | 19 ContentSettingsType content_type, |
31 const ResourceIdentifier& resource_identifier, | 20 const ResourceIdentifier& resource_identifier, |
32 bool incognito) const { | 21 bool incognito) const { |
33 return value_map_.GetRuleIterator(content_type, resource_identifier, NULL); | 22 return value_map_.GetRuleIterator(content_type, resource_identifier, NULL); |
34 } | 23 } |
(...skipping 13 matching lines...) Expand all Loading... |
48 resource_identifier, | 37 resource_identifier, |
49 value); | 38 value); |
50 return true; | 39 return true; |
51 } | 40 } |
52 | 41 |
53 void MockProvider::ShutdownOnUIThread() { | 42 void MockProvider::ShutdownOnUIThread() { |
54 RemoveAllObservers(); | 43 RemoveAllObservers(); |
55 } | 44 } |
56 | 45 |
57 } // namespace content_settings | 46 } // namespace content_settings |
OLD | NEW |