content_settings_observer.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
  5. #define ATOM_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
  6. #include "base/compiler_specific.h"
  7. #include "content/public/renderer/render_frame_observer.h"
  8. #include "third_party/WebKit/public/platform/WebContentSettingsClient.h"
  9. namespace atom {
  10. class ContentSettingsObserver : public content::RenderFrameObserver,
  11. public blink::WebContentSettingsClient {
  12. public:
  13. explicit ContentSettingsObserver(content::RenderFrame* render_frame);
  14. ~ContentSettingsObserver() override;
  15. // blink::WebContentSettingsClient implementation.
  16. bool AllowDatabase(const blink::WebString& name,
  17. const blink::WebString& display_name,
  18. unsigned estimated_size) override;
  19. bool AllowStorage(bool local) override;
  20. bool AllowIndexedDB(const blink::WebString& name,
  21. const blink::WebSecurityOrigin& security_origin) override;
  22. private:
  23. // content::RenderFrameObserver implementation.
  24. void OnDestruct() override;
  25. DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver);
  26. };
  27. } // namespace atom
  28. #endif // ATOM_RENDERER_CONTENT_SETTINGS_OBSERVER_H_