 Chromium Code Reviews
 Chromium Code Reviews Issue 6253012:
  Add ContentSettingsProvider Interface.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 6253012:
  Add ContentSettingsProvider Interface.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ | 
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ | 
| 7 #pragma once | 7 #pragma once | 
| 8 | 8 | 
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" | 
| 10 #include "chrome/browser/content_settings/content_settings_provider.h" | 10 #include "chrome/browser/content_settings/content_settings_provider.h" | 
| 11 | 11 | 
| 12 namespace content_settings { | 12 namespace content_settings { | 
| 13 | 13 | 
| 14 class MockContentSettingsProvider : public DefaultProviderInterface { | 14 class MockContentSettingsProvider : public DefaultProviderInterface, | 
| 15 public ProviderInterface { | |
| 15 public: | 16 public: | 
| 16 // Create a content settings provider that provides a given setting for a | 17 // Create a content settings provider that provides a given setting for a | 
| 17 // given type. | 18 // given type. | 
| 18 MockContentSettingsProvider(ContentSettingsType content_type, | 19 MockContentSettingsProvider(ContentSettingsType content_type, | 
| 19 ContentSetting setting, | 20 ContentSetting setting, | 
| 20 bool is_managed, | 21 bool is_managed, | 
| 21 bool can_override); | 22 bool can_override); | 
| 22 virtual ~MockContentSettingsProvider(); | 23 virtual ~MockContentSettingsProvider(); | 
| 23 | 24 | 
| 24 // ContentSettingsProviderInterface implementation. | 25 // DefaultProviderInterface implementation. | 
| 25 virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const; | 26 virtual bool CanProvideDefaultSetting(ContentSettingsType content_type) const; | 
| 26 virtual ContentSetting ProvideDefaultSetting( | 27 virtual ContentSetting ProvideDefaultSetting( | 
| 27 ContentSettingsType content_type) const; | 28 ContentSettingsType content_type) const; | 
| 28 virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 29 virtual void UpdateDefaultSetting(ContentSettingsType content_type, | 
| 29 ContentSetting setting); | 30 ContentSetting setting); | 
| 30 virtual void ResetToDefaults(); | 31 virtual void ResetToDefaults(); | 
| 31 virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; | 32 virtual bool DefaultSettingIsManaged(ContentSettingsType content_type) const; | 
| 32 | 33 | 
| 34 // ProviderInterface implementation | |
| 35 virtual ContentSetting GetContentSetting( | |
| 36 const GURL& requesting_url, | |
| 37 const GURL& embedding_url, | |
| 38 ContentSettingsType content_type, | |
| 39 const ResourceIdentifier& resource_identifier) const { | |
| 40 return CONTENT_SETTING_DEFAULT; | |
| 41 } | |
| 42 | |
| 43 virtual void SetContentSetting( | |
| 44 const ContentSettingsPattern& requesting_pattern, | |
| 
jochen (gone - plz use gerrit)
2011/02/01 12:33:11
nit. requesting_url_pattern and embedding_url_patt
 
markusheintz_
2011/02/01 12:38:01
Done.
 | |
| 45 const ContentSettingsPattern& embedding_pattern, | |
| 46 ContentSettingsType content_type, | |
| 47 const ResourceIdentifier& resource_identifier, | |
| 48 ContentSetting content_setting) {} | |
| 49 | |
| 50 virtual void GetAllContentSettingsRules( | |
| 51 ContentSettingsType content_type, | |
| 52 const ResourceIdentifier& resource_identifier, | |
| 53 Rules* content_setting_rules) const {} | |
| 54 | |
| 55 virtual void ClearAllContentSettingsRules() {} | |
| 56 | |
| 33 private: | 57 private: | 
| 34 ContentSettingsType content_type_; | 58 ContentSettingsType content_type_; | 
| 35 ContentSetting setting_; | 59 ContentSetting setting_; | 
| 36 bool is_managed_; | 60 bool is_managed_; | 
| 37 bool can_override_; | 61 bool can_override_; | 
| 38 | 62 | 
| 39 DISALLOW_COPY_AND_ASSIGN(MockContentSettingsProvider); | 63 DISALLOW_COPY_AND_ASSIGN(MockContentSettingsProvider); | 
| 40 }; | 64 }; | 
| 41 | 65 | 
| 42 } // namespace content_settings | 66 } // namespace content_settings | 
| 43 | 67 | 
| 44 #endif // CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ | 68 #endif // CHROME_BROWSER_CONTENT_SETTINGS_MOCK_CONTENT_SETTINGS_PROVIDER_H_ | 
| OLD | NEW |