Commonize boilerplate - impl
[platform/framework/web/chromium-efl.git] / tizen_src / impl / content_browser_client_efl.h
1 // Copyright 2014 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_BROWSER_CLIENT_EFL
6 #define CONTENT_BROWSER_CLIENT_EFL
7
8 #include "content/public/browser/content_browser_client.h"
9
10 namespace base {
11 class CommandLine;
12 }
13
14 class EWebContext;
15
16 namespace content {
17 class ResourceDispatcherHostDelegateEfl;
18 class BrowserMainPartsEfl;
19 class RenderViewHostDelegateView;
20 class WebContents;
21 class WebContentsView;
22 struct ShowDesktopNotificationHostMsgParams;
23
24 class ContentBrowserClientEfl: public ContentBrowserClient {
25  public:
26   ContentBrowserClientEfl();
27
28   virtual BrowserMainParts* CreateBrowserMainParts(
29       const MainFunctionParams& parameters) OVERRIDE;
30
31   virtual net::URLRequestContextGetter* CreateRequestContext(
32       BrowserContext* browser_context,
33       ProtocolHandlerMap* protocol_handlers,
34       URLRequestInterceptorScopedVector request_interceptors) OVERRIDE;
35
36   virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
37 #if defined(OS_TIZEN)
38   virtual LocationProvider* OverrideSystemLocationProvider() OVERRIDE;
39 #endif
40
41   // Allows the embedder to pass extra command line flags.
42   // switches::kProcessType will already be set at this point.
43   virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
44                                               int child_process_id) OVERRIDE;
45
46   virtual void ResourceDispatcherHostCreated() OVERRIDE;
47
48   virtual void AllowCertificateError(int render_process_id,
49                                      int render_frame_id,
50                                      int cert_error,
51                                      const net::SSLInfo& ssl_info,
52                                      const GURL& request_url,
53                                      ResourceType resource_type,
54                                      bool overridable,
55                                      bool strict_enforcement,
56                                      bool expired_previous_decision,
57                                      const base::Callback<void(bool)>& callback,
58                                      CertificateRequestResultType* result) OVERRIDE;
59
60   // Asks permission to show desktop notifications.
61   virtual void RequestDesktopNotificationPermission(const GURL& source_origin,
62       content::RenderFrameHost* render_frame_host,
63       const base::Callback<void(blink::WebNotificationPermission)>& callback) OVERRIDE;
64
65   // Show a desktop notification.  If |worker| is true, the request came from an
66   // HTML5 web worker, otherwise, it came from a renderer.
67   virtual void ShowDesktopNotification(
68       const content::ShowDesktopNotificationHostMsgParams& params,
69       content::RenderFrameHost* render_frame_host,
70       scoped_ptr<DesktopNotificationDelegate> delegate,
71       base::Closure* cancel_callback) OVERRIDE;
72
73   virtual bool AllowGetCookie(const GURL& url,
74                               const GURL& first_party,
75                               const net::CookieList& cookie_list,
76                               content::ResourceContext* context,
77                               int render_process_id,
78                               int render_frame_id) OVERRIDE;
79
80   virtual bool AllowSetCookie(const GURL& url,
81                               const GURL& first_party,
82                               const std::string& cookie_line,
83                               content::ResourceContext* context,
84                               int render_process_id,
85                               int render_frame_id,
86                               net::CookieOptions* options) OVERRIDE;
87
88   virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) OVERRIDE;
89
90   content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() OVERRIDE;
91
92  private:
93   scoped_ptr<ResourceDispatcherHostDelegateEfl> resource_disp_host_del_efl_;
94   EWebContext* web_context_;
95   BrowserMainPartsEfl* browser_main_parts_efl_;
96
97   DISALLOW_COPY_AND_ASSIGN(ContentBrowserClientEfl);
98 };
99
100 }
101
102 #endif // CONTENT_BROWSER_CLIENT_EFL