aw_content_settings_client.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2013 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. #ifndef ANDROID_WEBVIEW_RENDERER_AW_CONTENT_SETTINGS_CLIENT_H_
  5. #define ANDROID_WEBVIEW_RENDERER_AW_CONTENT_SETTINGS_CLIENT_H_
  6. #include "content/public/renderer/render_frame_observer.h"
  7. #include "third_party/blink/public/platform/web_content_settings_client.h"
  8. namespace android_webview {
  9. // Android WebView implementation of blink::WebContentSettingsClient.
  10. class AwContentSettingsClient : public content::RenderFrameObserver,
  11. public blink::WebContentSettingsClient {
  12. public:
  13. explicit AwContentSettingsClient(content::RenderFrame* render_view);
  14. AwContentSettingsClient(const AwContentSettingsClient&) = delete;
  15. AwContentSettingsClient& operator=(const AwContentSettingsClient&) = delete;
  16. private:
  17. ~AwContentSettingsClient() override;
  18. // content::RenderFrameObserver implementation.
  19. void OnDestruct() override;
  20. // blink::WebContentSettingsClient implementation.
  21. bool AllowImage(bool enabled_per_settings,
  22. const blink::WebURL& image_url) override;
  23. bool AllowScript(bool enabled_per_settings) override;
  24. bool AllowRunningInsecureContent(bool enabled_per_settings,
  25. const blink::WebURL& url) override;
  26. bool ShouldAutoupgradeMixedContent() override;
  27. bool ShouldAllowlistForContentSettings() const;
  28. };
  29. } // namespace android_webview
  30. #endif // ANDROID_WEBVIEW_RENDERER_AW_CONTENT_SETTINGS_CLIENT_H_