OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/mock_content_settings_provider.h" | 5 #include "chrome/browser/content_settings/mock_content_settings_provider.h" |
6 | 6 |
7 MockContentSettingsProvider::MockContentSettingsProvider( | 7 MockContentSettingsProvider::MockContentSettingsProvider( |
8 ContentSettingsType content_type, | 8 ContentSettingsType content_type, |
9 ContentSetting setting, | 9 ContentSetting setting, |
10 bool is_managed, | 10 bool is_managed, |
11 bool can_override) | 11 bool can_override) |
12 : content_type_(content_type), | 12 : content_type_(content_type), |
13 setting_(setting), | 13 setting_(setting), |
14 is_managed_(is_managed), | 14 is_managed_(is_managed), |
15 can_override_(can_override) { | 15 can_override_(can_override) { |
16 } | 16 } |
17 | 17 |
18 MockContentSettingsProvider::~MockContentSettingsProvider() { | 18 MockContentSettingsProvider::~MockContentSettingsProvider() { |
19 } | 19 } |
20 | 20 |
21 bool MockContentSettingsProvider::CanProvideDefaultSetting( | 21 bool MockContentSettingsProvider::CanProvideDefaultSetting( |
22 ContentSettingsType content_type) { | 22 ContentSettingsType content_type) const { |
23 return content_type == content_type_; | 23 return content_type == content_type_; |
24 } | 24 } |
25 | 25 |
26 ContentSetting MockContentSettingsProvider::ProvideDefaultSetting( | 26 ContentSetting MockContentSettingsProvider::ProvideDefaultSetting( |
27 ContentSettingsType content_type) { | 27 ContentSettingsType content_type) const { |
28 return content_type == content_type_ ? setting_ : CONTENT_SETTING_DEFAULT; | 28 return content_type == content_type_ ? setting_ : CONTENT_SETTING_DEFAULT; |
29 } | 29 } |
30 | 30 |
31 void MockContentSettingsProvider::UpdateDefaultSetting( | 31 void MockContentSettingsProvider::UpdateDefaultSetting( |
32 ContentSettingsType content_type, | 32 ContentSettingsType content_type, |
33 ContentSetting setting) { | 33 ContentSetting setting) { |
34 if (can_override_ && content_type == content_type_) | 34 if (can_override_ && content_type == content_type_) |
35 setting_ = setting; | 35 setting_ = setting; |
36 } | 36 } |
37 | 37 |
38 bool MockContentSettingsProvider::DefaultSettingIsManaged( | 38 bool MockContentSettingsProvider::DefaultSettingIsManaged( |
39 ContentSettingsType content_type) { | 39 ContentSettingsType content_type) const { |
40 return content_type == content_type_ && is_managed_; | 40 return content_type == content_type_ && is_managed_; |
41 } | 41 } |
| 42 |
| 43 void MockContentSettingsProvider::ResetToDefaults() { |
| 44 } |
OLD | NEW |