1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_CONTENT_SETTINGS_BROWSER_TEST_PAGE_SPECIFIC_CONTENT_SETTINGS_DELEGATE_H_ 6 #define COMPONENTS_CONTENT_SETTINGS_BROWSER_TEST_PAGE_SPECIFIC_CONTENT_SETTINGS_DELEGATE_H_ 7 8 #include "base/memory/scoped_refptr.h" 9 #include "components/content_settings/browser/page_specific_content_settings.h" 10 11 namespace content_settings { 12 13 class TestPageSpecificContentSettingsDelegate 14 : public PageSpecificContentSettings::Delegate { 15 public: 16 TestPageSpecificContentSettingsDelegate(PrefService* prefs, 17 HostContentSettingsMap* settings_map); 18 ~TestPageSpecificContentSettingsDelegate() override; 19 20 // PageSpecificContentSettings::Delegate: 21 void UpdateLocationBar() override; 22 void SetContentSettingRules( 23 content::RenderProcessHost* process, 24 const RendererContentSettingRules& rules) override; 25 PrefService* GetPrefs() override; 26 HostContentSettingsMap* GetSettingsMap() override; 27 ContentSetting GetEmbargoSetting(const GURL& request_origin, 28 ContentSettingsType permission) override; 29 std::vector<storage::FileSystemType> GetAdditionalFileSystemTypes() override; 30 browsing_data::CookieHelper::IsDeletionDisabledCallback 31 GetIsDeletionDisabledCallback() override; 32 bool IsMicrophoneCameraStateChanged( 33 PageSpecificContentSettings::MicrophoneCameraState 34 microphone_camera_state, 35 const std::string& media_stream_selected_audio_device, 36 const std::string& media_stream_selected_video_device) override; 37 PageSpecificContentSettings::MicrophoneCameraState GetMicrophoneCameraState() 38 override; 39 void OnContentAllowed(ContentSettingsType type) override; 40 void OnContentBlocked(ContentSettingsType type) override; 41 void OnCacheStorageAccessAllowed(const url::Origin& origin) override; 42 void OnCookieAccessAllowed(const net::CookieList& accessed_cookies) override; 43 void OnDomStorageAccessAllowed(const url::Origin& origin) override; 44 void OnFileSystemAccessAllowed(const url::Origin& origin) override; 45 void OnIndexedDBAccessAllowed(const url::Origin& origin) override; 46 void OnServiceWorkerAccessAllowed(const url::Origin& origin) override; 47 void OnWebDatabaseAccessAllowed(const url::Origin& origin) override; 48 49 private: 50 PrefService* prefs_; 51 scoped_refptr<HostContentSettingsMap> settings_map_; 52 }; 53 54 } // namespace content_settings 55 56 #endif // COMPONENTS_CONTENT_SETTINGS_BROWSER_TEST_PAGE_SPECIFIC_CONTENT_SETTINGS_DELEGATE_H_ 57