diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 12:48:44 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 12:48:44 +0000 |
commit | 2dd6bca0a1040075b094b73a100dbca424f4b2f8 (patch) | |
tree | 4f38c5eb4b0fa3b09480fce6b16429677a67e90e /chrome/browser/content_settings/content_settings_provider.h | |
parent | 9d01a6a5884920abb57f71b8fb9a1101bf15cca0 (diff) | |
download | chromium_src-2dd6bca0a1040075b094b73a100dbca424f4b2f8.zip chromium_src-2dd6bca0a1040075b094b73a100dbca424f4b2f8.tar.gz chromium_src-2dd6bca0a1040075b094b73a100dbca424f4b2f8.tar.bz2 |
Introduce a content settings provider interface.
BUG=64753
TEST=ContentSettingsProviderTest.*
Review URL: http://codereview.chromium.org/5269007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings/content_settings_provider.h')
-rw-r--r-- | chrome/browser/content_settings/content_settings_provider.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/chrome/browser/content_settings/content_settings_provider.h b/chrome/browser/content_settings/content_settings_provider.h new file mode 100644 index 0000000..3229779a --- /dev/null +++ b/chrome/browser/content_settings/content_settings_provider.h @@ -0,0 +1,38 @@ +// 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. + +// Interface for objects providing content setting rules. + +#ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ +#define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ +#pragma once + +#include "chrome/common/content_settings.h" + +class ContentSettingsProviderInterface { + public: + // True if this provider can provide a default setting for the |content_type|. + virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) = 0; + + // Returns the default content setting this provider has for the given + // |content_type|, or CONTENT_SETTING_DEFAULT if nothing be provided for this + // type. + virtual ContentSetting ProvideDefaultSetting( + ContentSettingsType content_type) = 0; + + // Notifies the provider that the host content settings map would like to + // update the default setting for the given |content_type|. The provider may + // ignore this. + virtual void UpdateDefaultSetting(ContentSettingsType content_type, + ContentSetting setting) = 0; + + // True if the default setting for the |content_type| is policy managed, i.e., + // there shouldn't be any UI shown to modify this setting. + virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) = 0; + + protected: + virtual ~ContentSettingsProviderInterface() {}; +}; + +#endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ |