OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/content_settings/mock_content_settings_provider.h" |
| 6 |
| 7 MockContentSettingsProvider::MockContentSettingsProvider( |
| 8 ContentSettingsType content_type, |
| 9 ContentSetting setting, |
| 10 bool is_managed, |
| 11 bool can_override) |
| 12 : content_type_(content_type), |
| 13 setting_(setting), |
| 14 is_managed_(is_managed), |
| 15 can_override_(can_override) { |
| 16 } |
| 17 |
| 18 MockContentSettingsProvider::~MockContentSettingsProvider() { |
| 19 } |
| 20 |
| 21 bool MockContentSettingsProvider::CanProvideDefaultSetting( |
| 22 ContentSettingsType content_type) { |
| 23 return content_type == content_type_; |
| 24 } |
| 25 |
| 26 ContentSetting MockContentSettingsProvider::ProvideDefaultSetting( |
| 27 ContentSettingsType content_type) { |
| 28 return content_type == content_type_ ? setting_ : CONTENT_SETTING_DEFAULT; |
| 29 } |
| 30 |
| 31 void MockContentSettingsProvider::UpdateDefaultSetting( |
| 32 ContentSettingsType content_type, |
| 33 ContentSetting setting) { |
| 34 if (can_override_ && content_type == content_type_) |
| 35 setting_ = setting; |
| 36 } |
| 37 |
| 38 bool MockContentSettingsProvider::DefaultSettingIsManaged( |
| 39 ContentSettingsType content_type) { |
| 40 return content_type == content_type_ && is_managed_; |
| 41 } |
OLD | NEW |