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