| 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 // Interface for objects providing content setting rules. | 5 // Interface for objects providing content setting rules. | 
| 6 | 6 | 
| 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 
| 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 
| 9 #pragma once | 9 #pragma once | 
| 10 | 10 | 
| 11 #include "chrome/common/content_settings.h" | 11 #include "chrome/common/content_settings.h" | 
| 12 | 12 | 
| 13 class ContentSettingsProviderInterface { | 13 class ContentSettingsProviderInterface { | 
| 14  public: | 14  public: | 
|  | 15   virtual ~ContentSettingsProviderInterface() {} | 
|  | 16 | 
| 15   // True if this provider can provide a default setting for the |content_type|. | 17   // True if this provider can provide a default setting for the |content_type|. | 
| 16   virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) = 0; | 18   virtual bool CanProvideDefaultSetting( | 
|  | 19       ContentSettingsType content_type) const = 0; | 
| 17 | 20 | 
| 18   // Returns the default content setting this provider has for the given | 21   // Returns the default content setting this provider has for the given | 
| 19   // |content_type|, or CONTENT_SETTING_DEFAULT if nothing be provided for this | 22   // |content_type|, or CONTENT_SETTING_DEFAULT if nothing be provided for this | 
| 20   // type. | 23   // type. | 
| 21   virtual ContentSetting ProvideDefaultSetting( | 24   virtual ContentSetting ProvideDefaultSetting( | 
| 22       ContentSettingsType content_type) = 0; | 25       ContentSettingsType content_type) const = 0; | 
| 23 | 26 | 
| 24   // Notifies the provider that the host content settings map would like to | 27   // Notifies the provider that the host content settings map would like to | 
| 25   // update the default setting for the given |content_type|. The provider may | 28   // update the default setting for the given |content_type|. The provider may | 
| 26   // ignore this. | 29   // ignore this. | 
| 27   virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 30   virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 
| 28                                     ContentSetting setting) = 0; | 31                                     ContentSetting setting) = 0; | 
| 29 | 32 | 
|  | 33   // Resets the state of the provider to the default. | 
|  | 34   virtual void ResetToDefaults() = 0; | 
|  | 35 | 
| 30   // True if the default setting for the |content_type| is policy managed, i.e., | 36   // True if the default setting for the |content_type| is policy managed, i.e., | 
| 31   // there shouldn't be any UI shown to modify this setting. | 37   // there shouldn't be any UI shown to modify this setting. | 
| 32   virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) = 0; | 38   virtual bool DefaultSettingIsManaged( | 
| 33 | 39       ContentSettingsType content_type) const = 0; | 
| 34  protected: |  | 
| 35   virtual ~ContentSettingsProviderInterface() {}; |  | 
| 36 }; | 40 }; | 
| 37 | 41 | 
| 38 #endif  // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 42 #endif  // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ | 
| OLD | NEW | 
|---|