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