5194e5b74e2e5bc2b88bfa69568d32a5cf47258a
[platform/framework/web/crosswalk-tizen.git] /
1 // Copyright 2016 Samsung Electronics. 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 CONTENT_SETTINGS_CLIENT_EFL_H_
6 #define CONTENT_SETTINGS_CLIENT_EFL_H_
7
8 #include "content/public/renderer/render_frame_observer.h"
9
10 #if defined(OS_TIZEN_TV_PRODUCT)
11 #include "content/public/renderer/render_frame_observer_tracker.h"
12 #endif
13 #include "third_party/WebKit/public/web/WebContentSettingsClient.h"
14
15 namespace content {
16
17 class ContentSettingsClientEfl
18     : public RenderFrameObserver,
19 #if defined(OS_TIZEN_TV_PRODUCT)
20       public RenderFrameObserverTracker<ContentSettingsClientEfl>,
21 #endif
22       public blink::WebContentSettingsClient {
23  public:
24   explicit ContentSettingsClientEfl(RenderFrame* render_view);
25   ~ContentSettingsClientEfl() override;
26
27   // content::RenderFrameObserver implementation.
28   void OnDestruct() override;
29
30   // blink::WebContentSettingsClient implementation.
31   void didNotAllowScript() override;
32
33 #if defined(OS_TIZEN_TV_PRODUCT)
34   // blink::WebContentSettingsClient implementation.
35   bool allowRunningInsecureContent(bool allowed_per_settings,
36                                    const blink::WebSecurityOrigin& context,
37                                    const blink::WebURL& url) override;
38   bool OnMessageReceived(const IPC::Message& message) override;
39 #endif
40
41  private:
42 #if defined(OS_TIZEN_TV_PRODUCT)
43   bool allowInsecureContent(bool allowed_per_settings);
44   void OnSetAllowInsecureContent(bool allow);
45
46   // Insecure content may be permitted for the duration of this render view.
47   bool mixed_content_state_;
48   bool allow_insecure_content_;
49 #endif
50   DISALLOW_COPY_AND_ASSIGN(ContentSettingsClientEfl);
51 };
52
53 }  // namespace content
54
55 #endif  // CONTENT_SETTINGS_CLIENT_EFL_H