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