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