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