Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2377)

Unified Diff: chrome/browser/content_settings/mock_content_settings_provider.cc

Issue 5269007: Introduce a content settings provider interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/content_settings
Patch Set: rebase Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
+}

Powered by Google App Engine
This is Rietveld 408576698