Chromium Code Reviews| Index: chrome/browser/content_settings/mock_content_settings_provider.cc |
| diff --git a/chrome/browser/content_settings/mock_content_settings_provider.cc b/chrome/browser/content_settings/mock_content_settings_provider.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..61e84e7cc75b7e715294b066420ebc51f0a05839 |
| --- /dev/null |
| +++ b/chrome/browser/content_settings/mock_content_settings_provider.cc |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/content_settings/mock_content_settings_provider.h" |
| + |
| +MockContentSettingsProvider::MockContentSettingsProvider( |
| + ContentSettingsType content_type, |
| + ContentSetting setting, |
| + bool is_managed, |
| + bool can_override) : |
|
gfeher
2010/11/30 12:29:12
Shouldn't the colon be in the next row?
jochen (gone - plz use gerrit)
2010/11/30 12:36:28
Done.
|
| + content_type_(content_type), |
| + setting_(setting), |
| + is_managed_(is_managed), |
| + can_override_(can_override) { |
| +} |
| + |
| +MockContentSettingsProvider::~MockContentSettingsProvider() { |
| +} |
| + |
| +bool MockContentSettingsProvider::canProvideDefaultSetting( |
| + ContentSettingsType content_type) { |
| + return content_type == content_type_; |
| +} |
| + |
| +ContentSetting MockContentSettingsProvider::provideDefaultSetting( |
| + ContentSettingsType content_type) { |
| + return content_type == content_type_ ? setting_ : CONTENT_SETTING_DEFAULT; |
| +} |
| + |
| +void MockContentSettingsProvider::updateDefaultSetting( |
| + ContentSettingsType content_type, |
| + ContentSetting setting) { |
| + if (can_override_ && content_type == content_type_) |
| + setting_ = setting; |
| +} |
| + |
| +bool MockContentSettingsProvider::defaultSettingIsManaged( |
| + ContentSettingsType content_type) { |
| + return content_type == content_type_ && is_managed_; |
| +} |