Offsreen Rendering support based on Ozone EFL
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / eweb_view.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 EWEB_VIEW_H
6 #define EWEB_VIEW_H
7
8 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
9 // FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to
10 // include instead.
11 #include <appcore-agent/service_app.h>
12 #endif
13
14 #include <map>
15 #include <string>
16 #include <Evas.h>
17 #include <locale.h>
18 #include <vector>
19
20 #include "base/callback.h"
21 #include "base/containers/id_map.h"
22 #include "base/synchronization/waitable_event.h"
23 #include "browser/inputpicker/InputPicker.h"
24 #include "browser/selectpicker/popup_picker.h"
25 #include "content/browser/renderer_host/event_with_latency_info.h"
26 #include "content/browser/selection/selection_controller_efl.h"
27 #include "content/public/browser/context_menu_params.h"
28 #include "content/public/browser/navigation_controller.h"
29 #include "content/public/browser/quota_permission_context.h"
30 #include "content/public/browser/web_contents_delegate.h"
31 #include "content/public/browser/web_contents_efl_delegate.h"
32 #include "content/public/common/input_event_ack_state.h"
33 #include "content_browser_client_efl.h"
34 #include "context_menu_controller_efl.h"
35 #include "eweb_context.h"
36 #include "eweb_view_callbacks.h"
37 #include "file_chooser_controller_efl.h"
38 #include "permission_popup_manager.h"
39 #include "popup_controller_efl.h"
40 #include "private/ewk_auth_challenge_private.h"
41 #include "private/ewk_back_forward_list_private.h"
42 #include "private/ewk_history_private.h"
43 #include "private/ewk_hit_test_private.h"
44 #include "private/ewk_settings_private.h"
45 #include "private/ewk_web_application_icon_data_private.h"
46 #include "public/ewk_hit_test_internal.h"
47 #include "public/ewk_touch_internal.h"
48 #include "public/ewk_view_product.h"
49 #include "scroll_detector.h"
50 #include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
51 #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
52 #include "ui/aura/window_tree_host.h"
53 #include "ui/gfx/geometry/point.h"
54 #include "ui/gfx/geometry/size.h"
55 #include "web_contents_delegate_efl.h"
56
57 namespace aura {
58 namespace client {
59 class FocusClient;
60 class WindowParentingClient;
61 }  // namespace client
62 }  // namespace aura
63
64 namespace content {
65 class RenderFrameHost;
66 class RenderViewHost;
67 class WebContentsDelegateEfl;
68 class ContextMenuControllerEfl;
69 class PopupControllerEfl;
70 }
71
72 class ErrorParams;
73 class _Ewk_Policy_Decision;
74 class _Ewk_Hit_Test;
75 class Ewk_Context;
76 class WebViewEvasEventHandler;
77 class _Ewk_Quota_Permission_Request;
78
79 template <typename CallbackPtr, typename CallbackParameter>
80 class WebViewCallback {
81  public:
82   WebViewCallback() { Set(nullptr, nullptr); }
83
84   void Set(CallbackPtr cb, void* data) {
85     callback_ = cb;
86     user_data_ = data;
87   }
88
89   bool IsCallbackSet() const { return callback_; }
90
91   Eina_Bool Run(Evas_Object* webview,
92                 CallbackParameter param,
93                 Eina_Bool* callback_result) {
94     CHECK(callback_result);
95     if (IsCallbackSet()) {
96       *callback_result = callback_(webview, param, user_data_);
97       return true;
98     }
99     return false;
100   }
101
102   void Run(Evas_Object* webview, CallbackParameter param) {
103     if (IsCallbackSet())
104       callback_(webview, param, user_data_);
105   }
106
107  private:
108   CallbackPtr callback_;
109   void* user_data_;
110 };
111
112 class WebApplicationIconUrlGetCallback {
113  public:
114   WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func,
115                                    void* user_data)
116       : func_(func), user_data_(user_data) {}
117   void Run(const std::string& url) {
118     if (func_) {
119       (func_)(url.c_str(), user_data_);
120     }
121   }
122
123  private:
124   Ewk_Web_App_Icon_URL_Get_Callback func_;
125   void* user_data_;
126 };
127
128 class WebApplicationIconUrlsGetCallback {
129  public:
130   WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func,
131                                     void* user_data)
132       : func_(func), user_data_(user_data) {}
133   void Run(const std::map<std::string, std::string>& urls) {
134     if (func_) {
135       Eina_List* list = NULL;
136       for (std::map<std::string, std::string>::const_iterator it = urls.begin();
137            it != urls.end(); ++it) {
138         _Ewk_Web_App_Icon_Data* data =
139             ewkWebAppIconDataCreate(it->first, it->second);
140         list = eina_list_append(list, data);
141       }
142       (func_)(list, user_data_);
143     }
144   }
145
146  private:
147   Ewk_Web_App_Icon_URLs_Get_Callback func_;
148   void* user_data_;
149 };
150
151 class WebApplicationCapableGetCallback {
152  public:
153   WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func,
154                                    void* user_data)
155       : func_(func), user_data_(user_data) {}
156   void Run(bool capable) {
157     if (func_) {
158       (func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
159     }
160   }
161
162  private:
163   Ewk_Web_App_Capable_Get_Callback func_;
164   void* user_data_;
165 };
166
167 class WebViewAsyncRequestHitTestDataCallback;
168 class JavaScriptDialogManagerEfl;
169 class PermissionPopupManager;
170
171 class EWebView {
172  public:
173   static EWebView* FromEvasObject(Evas_Object* eo);
174
175   EWebView(Ewk_Context*, Evas_Object* smart_object);
176   ~EWebView();
177
178   // initialize data members and activate event handlers.
179   // call this once after created and before use
180   void Initialize();
181
182   void CreateNewWindow(
183       content::WebContentsEflDelegate::WebContentsCreateCallback);
184   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
185
186   Ewk_Context* context() const { return context_.get(); }
187   Evas_Object* evas_object() const { return evas_object_; }
188   Evas_Object* native_view() const { return native_view_; }
189   Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
190   PermissionPopupManager* GetPermissionPopupManager() const {
191     return permission_popup_manager_.get();
192   }
193
194   content::WebContents& web_contents() const { return *web_contents_.get(); }
195
196   template <EWebViewCallbacks::CallbackType callbackType>
197   EWebViewCallbacks::CallBack<callbackType> SmartCallback() const {
198     return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
199   }
200
201   void set_magnifier(bool status);
202
203   // ewk_view api
204   void SetURL(const GURL& url);
205   const GURL& GetURL() const;
206   const GURL& GetOriginalURL() const;
207   void Reload();
208   void ReloadBypassingCache();
209   Eina_Bool CanGoBack();
210   Eina_Bool CanGoForward();
211   Eina_Bool HasFocus() const;
212   void SetFocus(Eina_Bool focus);
213   Eina_Bool GoBack();
214   Eina_Bool GoForward();
215   void Suspend();
216   void Resume();
217   void Stop();
218   double GetTextZoomFactor() const;
219   void SetTextZoomFactor(double text_zoom_factor);
220   double GetPageZoomFactor() const;
221   void SetPageZoomFactor(double page_zoom_factor);
222   void ExecuteEditCommand(const char* command, const char* value);
223   void SetOrientation(int orientation);
224   int GetOrientation();
225   bool TouchEventsEnabled() const;
226   void SetTouchEventsEnabled(bool enabled);
227   bool MouseEventsEnabled() const;
228   void SetMouseEventsEnabled(bool enabled);
229   void HandleTouchEvents(Ewk_Touch_Event_Type type,
230                          const Eina_List* points,
231                          const Evas_Modifier* modifiers);
232   void Show();
233   void Hide();
234   bool ExecuteJavaScript(const char* script,
235                          Ewk_View_Script_Execute_Callback callback,
236                          void* userdata);
237   bool SetUserAgent(const char* userAgent);
238   bool SetUserAgentAppName(const char* application_name);
239   bool SetPrivateBrowsing(bool incognito);
240   bool GetPrivateBrowsing() const;
241   const char* GetUserAgent() const;
242   const char* GetUserAgentAppName() const;
243   const char* GetSelectedText() const;
244   Ewk_Settings* GetSettings() { return settings_.get(); }
245   _Ewk_Frame* GetMainFrame();
246   void UpdateWebKitPreferences();
247   void LoadHTMLString(const char* html,
248                       const char* base_uri,
249                       const char* unreachable_uri);
250   void LoadPlainTextString(const char* plain_text);
251   void LoadData(const char* data,
252                 size_t size,
253                 const char* mime_type,
254                 const char* encoding,
255                 const char* base_uri,
256                 const char* unreachable_uri = NULL);
257
258   void InvokeLoadError(const GURL& url,
259                        int error_code,
260                        const std::string& error_description,
261                        bool is_main_frame);
262
263   void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
264                            void* user_data);
265   void InvokeAuthCallback(LoginDelegateEfl* login_delegate,
266                           const GURL& url,
267                           const std::string& realm);
268   void Find(const char* text, Ewk_Find_Options);
269   void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
270   void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
271   void ShowPopupMenu(const std::vector<blink::MenuItemInfo>& items,
272                      int selectedIndex,
273                      bool multiple);
274   Eina_Bool HidePopupMenu();
275   void UpdateFormNavigation(int formElementCount,
276                             int currentNodeIndex,
277                             bool prevState,
278                             bool nextState);
279   void FormNavigate(bool direction);
280   bool IsSelectPickerShown() const;
281   void CloseSelectPicker();
282   bool FormIsNavigating() const { return formIsNavigating_; }
283   void SetFormIsNavigating(bool formIsNavigating);
284   Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex);
285   Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
286   Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
287   Eina_Bool PopupMenuClose();
288   void HandleLongPressGesture(const content::ContextMenuParams&);
289   void ShowContextMenu(const content::ContextMenuParams&);
290   void CancelContextMenu(int request_id);
291   void SetScale(double scale_factor, int x, int y);
292   bool GetScrollPosition(int* x, int* y) const;
293   void SetScroll(int x, int y);
294   void UrlRequestSet(const char* url,
295                      content::NavigationController::LoadURLType loadtype,
296                      Eina_Hash* headers,
297                      const char* body);
298
299   content::SelectionControllerEfl* GetSelectionController() const;
300   content::PopupControllerEfl* GetPopupController() const {
301     return popup_controller_.get();
302   }
303   ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
304   void MoveCaret(const gfx::Point& point);
305   void QuerySelectionStyle();
306   void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
307   void SelectLinkText(const gfx::Point& touch_point);
308   bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
309   Eina_Bool ClearSelection();
310
311   // Callback OnCopyFromBackingStore will be called once we get the snapshot
312   // from render
313   void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
314
315   void RenderViewCreated(content::RenderViewHost* render_view_host);
316
317   /**
318    * Creates a snapshot of given rectangle from EWebView
319    *
320    * @param rect rectangle of EWebView which will be taken into snapshot
321    *
322    * @return created snapshot or NULL if error occured.
323    * @note ownership of snapshot is passed to caller
324   */
325   Evas_Object* GetSnapshot(Eina_Rectangle rect);
326
327   bool GetSnapshotAsync(Eina_Rectangle rect,
328                         Ewk_Web_App_Screenshot_Captured_Callback callback,
329                         void* user_data);
330   void InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision);
331   void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
332                                       NavigationPolicyParams params,
333                                       bool* handled);
334   void UseSettingsFont();
335
336   _Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
337   Eina_Bool AsyncRequestHitTestDataAt(int x,
338                                       int y,
339                                       Ewk_Hit_Test_Mode mode,
340                                       Ewk_View_Hit_Test_Request_Callback,
341                                       void* user_data);
342   _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x,
343                                                  int y,
344                                                  Ewk_Hit_Test_Mode mode);
345   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
346       int x,
347       int y,
348       Ewk_Hit_Test_Mode mode,
349       Ewk_View_Hit_Test_Request_Callback,
350       void* user_data);
351   void DispatchAsyncHitTestData(const Hit_Test_Params& params,
352                                 int64_t request_id);
353   void UpdateHitTestData(const Hit_Test_Params& params);
354
355   int current_find_request_id() const { return current_find_request_id_; }
356   bool PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
357   void InvokePlainTextGetCallback(const std::string& content_text,
358                                   int plain_text_get_callback_id);
359   int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback,
360                                      void* user_data);
361   void SetViewGeolocationPermissionCallback(
362       Ewk_View_Geolocation_Permission_Callback callback,
363       void* user_data);
364   bool InvokeViewGeolocationPermissionCallback(
365       _Ewk_Geolocation_Permission_Request*
366           geolocation_permission_request_context,
367       Eina_Bool* result);
368   void SetViewUserMediaPermissionCallback(
369       Ewk_View_User_Media_Permission_Callback callback,
370       void* user_data);
371   bool InvokeViewUserMediaPermissionCallback(
372       _Ewk_User_Media_Permission_Request* user_media_permission_request_context,
373       Eina_Bool* result);
374   void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback,
375                                    void* user_data);
376   bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
377                                       Eina_Bool* result);
378   void DidChangeContentsSize(int width, int height);
379   const Eina_Rectangle GetContentsSize() const;
380   void GetScrollSize(int* w, int* h);
381   void StopFinding();
382   void SetProgressValue(double progress);
383   double GetProgressValue();
384   const char* GetTitle();
385   bool SaveAsPdf(int width, int height, const std::string& file_name);
386   void BackForwardListClear();
387   _Ewk_Back_Forward_List* GetBackForwardList() const;
388   void InvokeBackForwardListChangedCallback();
389   _Ewk_History* GetBackForwardHistory() const;
390   bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback,
391                         void* userData);
392   bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback,
393                         void* userData);
394   bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback,
395                          void* userData);
396   void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
397   void InvokeWebAppIconUrlGetCallback(const std::string& iconUrl,
398                                       int callbackId);
399   void InvokeWebAppIconUrlsGetCallback(
400       const std::map<std::string, std::string>& iconUrls,
401       int callbackId);
402   void SetNotificationPermissionCallback(
403       Ewk_View_Notification_Permission_Callback callback,
404       void* user_data);
405   bool IsNotificationPermissionCallbackSet() const;
406   bool InvokeNotificationPermissionCallback(
407       Ewk_Notification_Permission_Request* request);
408
409   bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
410   void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
411   bool IsFullscreen();
412   void ExitFullscreen();
413   double GetScale();
414   void DidChangePageScaleFactor(double scale_factor);
415   void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
416                                   void* user_data);
417   void JavaScriptAlertReply();
418   void SetJavaScriptConfirmCallback(
419       Ewk_View_JavaScript_Confirm_Callback callback,
420       void* user_data);
421   void JavaScriptConfirmReply(bool result);
422   void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback,
423                                    void* user_data);
424   void JavaScriptPromptReply(const char* result);
425   void set_renderer_crashed();
426   void GetPageScaleRange(double* min_scale, double* max_scale);
427   void SetDrawsTransparentBackground(bool enabled);
428   void GetSessionData(const char** data, unsigned* length) const;
429   bool RestoreFromSessionData(const char* data, unsigned length);
430   void ShowFileChooser(content::RenderFrameHost* render_frame_host,
431                        const blink::mojom::FileChooserParams&);
432   void SetBrowserFont();
433   void SetCertificatePem(const std::string& certificate);
434   bool IsDragging() const;
435
436   void RequestColorPicker(int r, int g, int b, int a);
437   void DismissColorPicker();
438   bool SetColorPickerColor(int r, int g, int b, int a);
439   void InputPickerShow(ui::TextInputType input_type, double input_value);
440
441   void ShowContentsDetectedPopup(const char*);
442
443   // Returns TCP port number with Inspector, or 0 if error.
444   int StartInspectorServer(int port = 0);
445   bool StopInspectorServer();
446
447   void LoadNotFoundErrorPage(const std::string& invalidUrl);
448   static std::string GetPlatformLocale();
449   bool GetLinkMagnifierEnabled() const;
450   void SetLinkMagnifierEnabled(bool enabled);
451
452   void SetOverrideEncoding(const std::string& encoding);
453   void SetQuotaPermissionRequestCallback(
454       Ewk_Quota_Permission_Request_Callback callback,
455       void* user_data);
456   void InvokeQuotaPermissionRequest(
457       _Ewk_Quota_Permission_Request* request,
458       content::QuotaPermissionContext::PermissionCallback cb);
459   void QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
460                          bool allow);
461   void QuotaRequestCancel(const _Ewk_Quota_Permission_Request* request);
462 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
463   void SetViewMode(blink::WebViewMode view_mode);
464 #endif
465   gfx::Point GetContextMenuPosition() const;
466
467   content::ContextMenuControllerEfl* GetContextMenuController() {
468     return context_menu_.get();
469   }
470   void ResetContextMenuController();
471
472   /// ---- Event handling
473   bool HandleShow();
474   bool HandleHide();
475   bool HandleMove(int x, int y);
476   bool HandleResize(int width, int height);
477   bool HandleTextSelectionDown(int x, int y);
478   bool HandleTextSelectionUp(int x, int y);
479
480   void HandleRendererProcessCrash();
481   void InvokeWebProcessCrashedCallback();
482
483   void HandleTapGestureForSelection(bool is_content_editable);
484   void HandleZoomGesture(blink::WebGestureEvent& event);
485   void ClosePage();
486
487   void SyncAcceptLanguages(const std::string& accept_languages);
488
489   void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
490                       const gfx::Vector2dF& latest_overscroll_delta);
491
492  private:
493   void InitializeContent();
494   void InitializeWindowTreeHost();
495   void SendDelayedMessages(content::RenderViewHost* render_view_host);
496
497   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
498   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
499       int x,
500       int y,
501       Ewk_Hit_Test_Mode mode,
502       WebViewAsyncRequestHitTestDataCallback* cb);
503 #if !defined(USE_AURA)
504   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
505 #endif
506 #if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
507   static void cameraResultCb(service_h request,
508                              service_h reply,
509                              service_result_e result,
510                              void* data);
511 #endif
512
513 #if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
514   bool LaunchCamera(std::u16string mimetype);
515 #endif
516 #if !defined(USE_AURA)
517   content::RenderWidgetHostViewEfl* rwhv() const;
518 #endif
519   JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
520
521   void ReleasePopupMenuList();
522
523   void ShowContextMenuInternal(const content::ContextMenuParams&);
524
525   void UpdateWebkitPreferencesEfl(content::RenderViewHost*);
526
527   void ChangeScroll(int& x, int& y);
528
529   scoped_refptr<WebViewEvasEventHandler> evas_event_handler_;
530   scoped_refptr<Ewk_Context> context_;
531   scoped_refptr<Ewk_Context> old_context_;
532   std::unique_ptr<content::WebContents> web_contents_;
533   std::unique_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
534   std::string pending_url_request_;
535   std::unique_ptr<Ewk_Settings> settings_;
536   std::unique_ptr<_Ewk_Frame> frame_;
537   std::unique_ptr<_Ewk_Policy_Decision> window_policy_;
538   Evas_Object* evas_object_;
539   Evas_Object* native_view_;
540   bool touch_events_enabled_;
541   bool mouse_events_enabled_;
542   double text_zoom_factor_;
543   mutable std::string user_agent_;
544   mutable std::string user_agent_app_name_;
545   std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_;
546
547   Eina_List* popupMenuItems_;
548   Popup_Picker* popupPicker_;
549   bool formIsNavigating_;
550   typedef struct {
551     int count;
552     int position;
553     bool prevState;
554     bool nextState;
555   } formNavigation;
556   formNavigation formNavigation_;
557   std::unique_ptr<content::ContextMenuControllerEfl> context_menu_;
558 #if !defined(EWK_BRINGUP)  // FIXME: m71 bringup
559   std::unique_ptr<content::FileChooserControllerEfl> file_chooser_;
560 #endif
561   std::unique_ptr<content::PopupControllerEfl> popup_controller_;
562   std::u16string previous_text_;
563   int current_find_request_id_;
564   static int find_request_id_counter_;
565
566   typedef WebViewCallback<Ewk_View_Plain_Text_Get_Callback, const char*>
567       EwkViewPlainTextGetCallback;
568   base::IDMap<EwkViewPlainTextGetCallback*> plain_text_get_callback_map_;
569
570   typedef WebViewCallback<Ewk_View_MHTML_Data_Get_Callback, const char*>
571       MHTMLCallbackDetails;
572   base::IDMap<MHTMLCallbackDetails*> mhtml_callback_map_;
573
574   gfx::Size contents_size_;
575   double progress_;
576   mutable std::string title_;
577   mutable std::string pem_certificate_;
578   Hit_Test_Params hit_test_params_;
579   base::WaitableEvent hit_test_completion_;
580   double page_scale_factor_;
581   double x_delta_;
582   double y_delta_;
583
584   WebViewCallback<Ewk_View_Geolocation_Permission_Callback,
585                   _Ewk_Geolocation_Permission_Request*>
586       geolocation_permission_cb_;
587   WebViewCallback<Ewk_View_User_Media_Permission_Callback,
588                   _Ewk_User_Media_Permission_Request*>
589       user_media_permission_cb_;
590   WebViewCallback<Ewk_View_Unfocus_Allow_Callback, Ewk_Unfocus_Direction>
591       unfocus_allow_cb_;
592   WebViewCallback<Ewk_View_Notification_Permission_Callback,
593                   Ewk_Notification_Permission_Request*>
594       notification_permission_callback_;
595   WebViewCallback<Ewk_Quota_Permission_Request_Callback,
596                   const _Ewk_Quota_Permission_Request*>
597       quota_request_callback_;
598   WebViewCallback<Ewk_View_Authentication_Callback, _Ewk_Auth_Challenge*>
599       authentication_cb_;
600
601   std::unique_ptr<content::InputPicker> inputPicker_;
602   base::IDMap<WebApplicationIconUrlGetCallback*>
603       web_app_icon_url_get_callback_map_;
604   base::IDMap<WebApplicationIconUrlsGetCallback*>
605       web_app_icon_urls_get_callback_map_;
606   base::IDMap<WebApplicationCapableGetCallback*>
607       web_app_capable_get_callback_map_;
608   std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
609   std::unique_ptr<ScrollDetector> scroll_detector_;
610
611 #if defined(OS_TIZEN)
612   blink::mojom::FileChooserParams::Mode filechooser_mode_;
613 #endif
614   std::map<const _Ewk_Quota_Permission_Request*,
615            content::QuotaPermissionContext::PermissionCallback>
616       quota_permission_request_map_;
617
618   bool is_initialized_;
619
620   std::unique_ptr<_Ewk_Back_Forward_List> back_forward_list_;
621
622   static content::WebContentsEflDelegate::WebContentsCreateCallback
623       create_new_window_web_contents_cb_;
624
625  private:
626   gfx::Vector2d previous_scroll_position_;
627
628   gfx::Point context_menu_position_;
629
630   std::vector<IPC::Message*> delayed_messages_;
631
632   std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
633
634   content::ContentBrowserClientEfl::AcceptLangsChangedCallback
635       accept_langs_changed_callback_;
636
637   std::unique_ptr<aura::WindowTreeHost> host_;
638   std::unique_ptr<aura::client::FocusClient> focus_client_;
639   std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
640 };
641
642 const unsigned int g_default_tilt_motion_sensitivity = 3;
643
644 #endif