Add Tizen-platform implementation of ContentMainDelegate, of ResourceDispatcherHostDe...
[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
33 class ResourceDispatcherHostDelegateEfl;
34 class BrowserMainPartsEfl;
35 class RenderViewHostDelegateView;
36 class WebContents;
37 class WebContentsView;
38
39 class ContentBrowserClientEfl: public ContentBrowserClient {
40  public:
41   ContentBrowserClientEfl();
42
43   virtual BrowserMainParts* CreateBrowserMainParts(
44       const MainFunctionParams& parameters) OVERRIDE;
45
46   virtual WebContentsView* OverrideCreateWebContentsView(
47       WebContents* web_contents,
48       RenderViewHostDelegateView** delegate_view) OVERRIDE;
49
50   virtual net::URLRequestContextGetter* CreateRequestContext(
51       content::BrowserContext* browser_context,
52       content::ProtocolHandlerMap* protocol_handlers) OVERRIDE;
53
54   virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
55 #if defined(OS_TIZEN)
56   virtual LocationProvider* OverrideSystemLocationProvider() OVERRIDE;
57 #endif
58
59   // Allows the embedder to pass extra command line flags.
60   // switches::kProcessType will already be set at this point.
61   virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
62                                               int child_process_id) OVERRIDE;
63
64   virtual void ResourceDispatcherHostCreated() OVERRIDE;
65
66   virtual void AllowCertificateError(int render_process_id,
67                                      int render_frame_id,
68                                      int cert_error,
69                                      const net::SSLInfo& ssl_info,
70                                      const GURL& request_url,
71                                      ResourceType::Type resource_type,
72                                      bool overridable,
73                                      bool strict_enforcement,
74                                      const base::Callback<void(bool)>& callback,
75                                      CertificateRequestResultType* result) OVERRIDE;
76
77   // Asks permission to show desktop notifications.
78   virtual void RequestDesktopNotificationPermission(const GURL& source_origin,
79                                                     int callback_context,
80                                                     int render_process_id,
81                                                     int render_view_id) OVERRIDE;
82
83   // Show a desktop notification.  If |worker| is true, the request came from an
84   // HTML5 web worker, otherwise, it came from a renderer.
85   virtual void ShowDesktopNotification(const ShowDesktopNotificationHostMsgParams& params,
86                                        int render_process_id,
87                                        int render_view_id,
88                                        bool worker) OVERRIDE;
89
90   virtual bool AllowGetCookie(const GURL& url,
91                               const GURL& first_party,
92                               const net::CookieList& cookie_list,
93                               content::ResourceContext* context,
94                               int render_process_id,
95                               int render_frame_id) OVERRIDE;
96
97   virtual bool AllowSetCookie(const GURL& url,
98                               const GURL& first_party,
99                               const std::string& cookie_line,
100                               content::ResourceContext* context,
101                               int render_process_id,
102                               int render_frame_id,
103                               net::CookieOptions* options) OVERRIDE;
104
105   virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) OVERRIDE;
106
107  private:
108   scoped_ptr<ResourceDispatcherHostDelegateEfl> resource_disp_host_del_efl_;
109   EWebContext* web_context_;
110   BrowserMainPartsEfl* browser_main_parts_efl_;
111
112   DISALLOW_COPY_AND_ASSIGN(ContentBrowserClientEfl);
113 };
114
115 }
116
117 #endif // CONTENT_BROWSER_CLIENT_EFL