[M108 Migration] Migrate patches related to NavigationThrottle and Ewk_Error
[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 RenderWidgetHostViewAura;
68 class WebContentsDelegateEfl;
69 class ContextMenuControllerEfl;
70 class PopupControllerEfl;
71 }
72
73 class ErrorParams;
74 class _Ewk_Policy_Decision;
75 class _Ewk_Hit_Test;
76 class Ewk_Context;
77 class WebViewEvasEventHandler;
78 class _Ewk_Quota_Permission_Request;
79
80 template <typename CallbackPtr, typename CallbackParameter>
81 class WebViewCallback {
82  public:
83   WebViewCallback() { Set(nullptr, nullptr); }
84
85   void Set(CallbackPtr cb, void* data) {
86     callback_ = cb;
87     user_data_ = data;
88   }
89
90   bool IsCallbackSet() const { return callback_; }
91
92   Eina_Bool Run(Evas_Object* webview,
93                 CallbackParameter param,
94                 Eina_Bool* callback_result) {
95     CHECK(callback_result);
96     if (IsCallbackSet()) {
97       *callback_result = callback_(webview, param, user_data_);
98       return true;
99     }
100     return false;
101   }
102
103   void Run(Evas_Object* webview, CallbackParameter param) {
104     if (IsCallbackSet())
105       callback_(webview, param, user_data_);
106   }
107
108  private:
109   CallbackPtr callback_;
110   void* user_data_;
111 };
112
113 class WebApplicationIconUrlGetCallback {
114  public:
115   WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func,
116                                    void* user_data)
117       : func_(func), user_data_(user_data) {}
118   void Run(const std::string& url) {
119     if (func_) {
120       (func_)(url.c_str(), user_data_);
121     }
122   }
123
124  private:
125   Ewk_Web_App_Icon_URL_Get_Callback func_;
126   void* user_data_;
127 };
128
129 class WebApplicationIconUrlsGetCallback {
130  public:
131   WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func,
132                                     void* user_data)
133       : func_(func), user_data_(user_data) {}
134   void Run(const std::map<std::string, std::string>& urls) {
135     if (func_) {
136       Eina_List* list = NULL;
137       for (std::map<std::string, std::string>::const_iterator it = urls.begin();
138            it != urls.end(); ++it) {
139         _Ewk_Web_App_Icon_Data* data =
140             ewkWebAppIconDataCreate(it->first, it->second);
141         list = eina_list_append(list, data);
142       }
143       (func_)(list, user_data_);
144     }
145   }
146
147  private:
148   Ewk_Web_App_Icon_URLs_Get_Callback func_;
149   void* user_data_;
150 };
151
152 class WebApplicationCapableGetCallback {
153  public:
154   WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func,
155                                    void* user_data)
156       : func_(func), user_data_(user_data) {}
157   void Run(bool capable) {
158     if (func_) {
159       (func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
160     }
161   }
162
163  private:
164   Ewk_Web_App_Capable_Get_Callback func_;
165   void* user_data_;
166 };
167
168 class WebViewAsyncRequestHitTestDataCallback;
169 class JavaScriptDialogManagerEfl;
170 class PermissionPopupManager;
171
172 class EWebView {
173  public:
174   static EWebView* FromEvasObject(Evas_Object* eo);
175
176   EWebView(Ewk_Context*, Evas_Object* smart_object);
177   ~EWebView();
178
179   // initialize data members and activate event handlers.
180   // call this once after created and before use
181   void Initialize();
182
183   bool CreateNewWindow(
184       content::WebContentsEflDelegate::WebContentsCreateCallback);
185   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
186
187   content::RenderWidgetHostViewAura* rwhva() const;
188   Ewk_Context* context() const { return context_.get(); }
189   Evas_Object* evas_object() const { return evas_object_; }
190   Evas_Object* native_view() const { return native_view_; }
191   Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
192   PermissionPopupManager* GetPermissionPopupManager() const {
193     return permission_popup_manager_.get();
194   }
195
196   content::WebContents& web_contents() const { return *web_contents_.get(); }
197
198   template <EWebViewCallbacks::CallbackType callbackType>
199   EWebViewCallbacks::CallBack<callbackType> SmartCallback() const {
200     return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
201   }
202
203   void set_magnifier(bool status);
204
205   // ewk_view api
206   void SetURL(const GURL& url);
207   const GURL& GetURL() const;
208   const GURL& GetOriginalURL() const;
209   void Reload();
210   void ReloadBypassingCache();
211   Eina_Bool CanGoBack();
212   Eina_Bool CanGoForward();
213   Eina_Bool HasFocus() const;
214   void SetFocus(Eina_Bool focus);
215   Eina_Bool GoBack();
216   Eina_Bool GoForward();
217   void Suspend();
218   void Resume();
219   void Stop();
220   double GetTextZoomFactor() const;
221   void SetTextZoomFactor(double text_zoom_factor);
222   double GetPageZoomFactor() const;
223   void SetPageZoomFactor(double page_zoom_factor);
224   void ExecuteEditCommand(const char* command, const char* value);
225   void SetOrientation(int orientation);
226   int GetOrientation();
227   bool TouchEventsEnabled() const;
228   void SetTouchEventsEnabled(bool enabled);
229   bool MouseEventsEnabled() const;
230   void SetMouseEventsEnabled(bool enabled);
231   void HandleTouchEvents(Ewk_Touch_Event_Type type,
232                          const Eina_List* points,
233                          const Evas_Modifier* modifiers);
234   void Show();
235   void Hide();
236   bool ExecuteJavaScript(const char* script,
237                          Ewk_View_Script_Execute_Callback callback,
238                          void* userdata);
239   bool SetUserAgent(const char* userAgent);
240   bool SetUserAgentAppName(const char* application_name);
241   bool SetPrivateBrowsing(bool incognito);
242   bool GetPrivateBrowsing() const;
243   const char* GetUserAgent() const;
244   const char* GetUserAgentAppName() const;
245   const char* CacheSelectedText();
246   Ewk_Settings* GetSettings() { return settings_.get(); }
247   _Ewk_Frame* GetMainFrame();
248   void UpdateWebKitPreferences();
249   void LoadHTMLString(const char* html,
250                       const char* base_uri,
251                       const char* unreachable_uri);
252   void LoadPlainTextString(const char* plain_text);
253   void LoadData(const char* data,
254                 size_t size,
255                 const char* mime_type,
256                 const char* encoding,
257                 const char* base_uri,
258                 const char* unreachable_uri = NULL);
259
260   void InvokeLoadError(const GURL& url, int error_code, bool is_cancellation);
261
262   void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
263                            void* user_data);
264   void InvokeAuthCallback(LoginDelegateEfl* login_delegate,
265                           const GURL& url,
266                           const std::string& realm);
267   void Find(const char* text, Ewk_Find_Options);
268   void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
269   void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
270   void ShowPopupMenu(const std::vector<blink::MenuItemInfo>& items,
271                      int selectedIndex,
272                      bool multiple);
273   Eina_Bool HidePopupMenu();
274   void UpdateFormNavigation(int formElementCount,
275                             int currentNodeIndex,
276                             bool prevState,
277                             bool nextState);
278   void FormNavigate(bool direction);
279   bool IsSelectPickerShown() const;
280   void CloseSelectPicker();
281   bool FormIsNavigating() const { return formIsNavigating_; }
282   void SetFormIsNavigating(bool formIsNavigating);
283   Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex);
284   Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
285   Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
286   Eina_Bool PopupMenuClose();
287   void HandleLongPressGesture(const content::ContextMenuParams&);
288   void ShowContextMenu(const content::ContextMenuParams&);
289   void CancelContextMenu(int request_id);
290   void SetScale(double scale_factor);
291   bool GetScrollPosition(int* x, int* y) const;
292   void SetScroll(int x, int y);
293   void UrlRequestSet(const char* url,
294                      content::NavigationController::LoadURLType loadtype,
295                      Eina_Hash* headers,
296                      const char* body);
297
298   content::SelectionControllerEfl* GetSelectionController() const;
299   content::PopupControllerEfl* GetPopupController() const {
300     return popup_controller_.get();
301   }
302   ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
303   void MoveCaret(const gfx::Point& point);
304   void QuerySelectionStyle();
305   void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
306   void SelectLinkText(const gfx::Point& touch_point);
307   bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
308   Eina_Bool ClearSelection();
309
310   // Callback OnCopyFromBackingStore will be called once we get the snapshot
311   // from render
312   void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
313
314   void RenderViewCreated(content::RenderViewHost* render_view_host);
315
316   /**
317    * Creates a snapshot of given rectangle from EWebView
318    *
319    * @param rect rectangle of EWebView which will be taken into snapshot
320    *
321    * @return created snapshot or NULL if error occured.
322    * @note ownership of snapshot is passed to caller
323   */
324   Evas_Object* GetSnapshot(Eina_Rectangle rect);
325
326   bool GetSnapshotAsync(Eina_Rectangle rect,
327                         Ewk_Web_App_Screenshot_Captured_Callback callback,
328                         void* user_data);
329   void InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision);
330   void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
331                                       NavigationPolicyParams params,
332                                       bool* handled);
333   void UseSettingsFont();
334
335   _Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
336   Eina_Bool AsyncRequestHitTestDataAt(int x,
337                                       int y,
338                                       Ewk_Hit_Test_Mode mode,
339                                       Ewk_View_Hit_Test_Request_Callback,
340                                       void* user_data);
341   _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x,
342                                                  int y,
343                                                  Ewk_Hit_Test_Mode mode);
344   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
345       int x,
346       int y,
347       Ewk_Hit_Test_Mode mode,
348       Ewk_View_Hit_Test_Request_Callback,
349       void* user_data);
350   void DispatchAsyncHitTestData(const Hit_Test_Params& params,
351                                 int64_t request_id);
352   void UpdateHitTestData(const Hit_Test_Params& params);
353
354   int current_find_request_id() const { return current_find_request_id_; }
355   bool PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
356   void InvokePlainTextGetCallback(const std::string& content_text,
357                                   int plain_text_get_callback_id);
358   int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback,
359                                      void* user_data);
360   void SetViewGeolocationPermissionCallback(
361       Ewk_View_Geolocation_Permission_Callback callback,
362       void* user_data);
363   bool InvokeViewGeolocationPermissionCallback(
364       _Ewk_Geolocation_Permission_Request*
365           geolocation_permission_request_context,
366       Eina_Bool* result);
367   void SetViewUserMediaPermissionCallback(
368       Ewk_View_User_Media_Permission_Callback callback,
369       void* user_data);
370   bool InvokeViewUserMediaPermissionCallback(
371       _Ewk_User_Media_Permission_Request* user_media_permission_request_context,
372       Eina_Bool* result);
373   void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback,
374                                    void* user_data);
375   bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
376                                       Eina_Bool* result);
377   void DidChangeContentsSize(int width, int height);
378   const Eina_Rectangle GetContentsSize() const;
379   void GetScrollSize(int* w, int* h);
380   void StopFinding();
381   void SetProgressValue(double progress);
382   double GetProgressValue();
383   const char* GetTitle();
384   bool SaveAsPdf(int width, int height, const std::string& file_name);
385   void BackForwardListClear();
386   _Ewk_Back_Forward_List* GetBackForwardList() const;
387   void InvokeBackForwardListChangedCallback();
388   _Ewk_History* GetBackForwardHistory() const;
389   bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback,
390                         void* userData);
391   bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback,
392                         void* userData);
393   bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback,
394                          void* userData);
395   void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
396   void InvokeWebAppIconUrlGetCallback(const std::string& iconUrl,
397                                       int callbackId);
398   void InvokeWebAppIconUrlsGetCallback(
399       const std::map<std::string, std::string>& iconUrls,
400       int callbackId);
401   void SetNotificationPermissionCallback(
402       Ewk_View_Notification_Permission_Callback callback,
403       void* user_data);
404   bool IsNotificationPermissionCallbackSet() const;
405   bool InvokeNotificationPermissionCallback(
406       Ewk_Notification_Permission_Request* request);
407
408   bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
409   void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
410   bool IsFullscreen();
411   void ExitFullscreen();
412   double GetScale();
413   void DidChangePageScaleFactor(double scale_factor);
414   void SetScaledContentsSize();
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 RequestManifest(Ewk_View_Request_Manifest_Callback callback,
488                        void* user_data);
489   void DidRespondRequestManifest(_Ewk_View_Request_Manifest* manifest,
490                                  Ewk_View_Request_Manifest_Callback callback,
491                                  void* user_data);
492
493   void SyncAcceptLanguages(const std::string& accept_languages);
494
495   void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
496                       const gfx::Vector2dF& latest_overscroll_delta);
497
498  private:
499   void InitializeContent();
500   void InitializeWindowTreeHost();
501   void SendDelayedMessages(content::RenderViewHost* render_view_host);
502
503   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
504   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
505       int x,
506       int y,
507       Ewk_Hit_Test_Mode mode,
508       WebViewAsyncRequestHitTestDataCallback* cb);
509 #if !defined(USE_AURA)
510   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
511 #endif
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> inputPicker_;
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