d3f7280f1560f0d589f4dd7c6c275f5cc4d9f312
[platform/framework/web/chromium-efl.git] / tizen_src / impl / content_browser_client_efl.h
1 /*
2    Copyright (C) 2014 Samsung Electronics
3
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Library General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later version.
8
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Library General Public License for more details.
13
14     You should have received a copy of the GNU Library General Public License
15     along with this library; see the file COPYING.LIB.  If not, write to
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef CONTENT_BROWSER_CLIENT_EFL
21 #define CONTENT_BROWSER_CLIENT_EFL
22
23 #include "content/public/browser/content_browser_client.h"
24
25 namespace base {
26 class CommandLine;
27 }
28
29 class EWebContext;
30
31 namespace content {
32 class ResourceDispatcherHostDelegateEfl;
33 class BrowserMainPartsEfl;
34 class RenderViewHostDelegateView;
35 class WebContents;
36 class WebContentsView;
37 struct ShowDesktopNotificationHostMsgParams;
38
39 class ContentBrowserClientEfl: public ContentBrowserClient {
40  public:
41   ContentBrowserClientEfl();
42
43   virtual BrowserMainParts* CreateBrowserMainParts(
44       const MainFunctionParams& parameters) OVERRIDE;
45
46   virtual net::URLRequestContextGetter* CreateRequestContext(
47       BrowserContext* browser_context,
48       ProtocolHandlerMap* protocol_handlers,
49       URLRequestInterceptorScopedVector request_interceptors) OVERRIDE;
50
51   virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
52 #if defined(OS_TIZEN)
53   virtual LocationProvider* OverrideSystemLocationProvider() OVERRIDE;
54 #endif
55
56   // Allows the embedder to pass extra command line flags.
57   // switches::kProcessType will already be set at this point.
58   virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
59                                               int child_process_id) OVERRIDE;
60
61   virtual void ResourceDispatcherHostCreated() OVERRIDE;
62
63   virtual void AllowCertificateError(int render_process_id,
64                                      int render_frame_id,
65                                      int cert_error,
66                                      const net::SSLInfo& ssl_info,
67                                      const GURL& request_url,
68                                      ResourceType::Type resource_type,
69                                      bool overridable,
70                                      bool strict_enforcement,
71                                      const base::Callback<void(bool)>& callback,
72                                      CertificateRequestResultType* result) OVERRIDE;
73
74   // Asks permission to show desktop notifications.
75   virtual void RequestDesktopNotificationPermission(const GURL& source_origin,
76                                                     content::RenderFrameHost* render_frame_host,
77                                                     const base::Closure& callback) OVERRIDE;
78
79   // Show a desktop notification.  If |worker| is true, the request came from an
80   // HTML5 web worker, otherwise, it came from a renderer.
81   virtual void ShowDesktopNotification(
82       const content::ShowDesktopNotificationHostMsgParams& params,
83       content::RenderFrameHost* render_frame_host,
84       content::DesktopNotificationDelegate* delegate,
85       base::Closure* cancel_callback) OVERRIDE;
86
87   virtual bool AllowGetCookie(const GURL& url,
88                               const GURL& first_party,
89                               const net::CookieList& cookie_list,
90                               content::ResourceContext* context,
91                               int render_process_id,
92                               int render_frame_id) OVERRIDE;
93
94   virtual bool AllowSetCookie(const GURL& url,
95                               const GURL& first_party,
96                               const std::string& cookie_line,
97                               content::ResourceContext* context,
98                               int render_process_id,
99                               int render_frame_id,
100                               net::CookieOptions* options) OVERRIDE;
101
102   virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) OVERRIDE;
103
104  private:
105   scoped_ptr<ResourceDispatcherHostDelegateEfl> resource_disp_host_del_efl_;
106   EWebContext* web_context_;
107   BrowserMainPartsEfl* browser_main_parts_efl_;
108
109   DISALLOW_COPY_AND_ASSIGN(ContentBrowserClientEfl);
110 };
111
112 }
113
114 #endif // CONTENT_BROWSER_CLIENT_EFL