Improve renderer process crash handling in EWK.
[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 "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       bool show_selection = true);
316   void CancelContextMenu(int request_id);
317   void SetScale(double scale_factor, int x, int y);
318   bool GetScrollPosition(int* x, int* y) const;
319   void SetScroll(int x, int y);
320   void UrlRequestSet(const char* url,
321       content::NavigationController::LoadURLType loadtype,
322       Eina_Hash* headers,
323       const char* body);
324
325   content::SelectionControllerEfl* GetSelectionController() const { return selection_controller_.get(); }
326   content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); }
327   ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
328   void MoveCaret(const gfx::Point& point);
329   void QuerySelectionStyle();
330   void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
331   void SelectClosestWord(const gfx::Point& touch_point);
332   void SelectLinkText(const gfx::Point& touch_point);
333   bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
334   void GetSnapShotForRect(gfx::Rect& rect);
335
336   // Callback OnCopyFromBackingStore will be called once we get the snapshot from render
337   void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
338
339   void RenderViewCreated(content::RenderViewHost* render_view_host);
340
341   /**
342    * Creates a snapshot of given rectangle from EWebView
343    *
344    * @param rect rectangle of EWebView which will be taken into snapshot
345    *
346    * @return created snapshot or NULL if error occured.
347    * @note ownership of snapshot is passed to caller
348   */
349   Evas_Object* GetSnapshot(Eina_Rectangle rect);
350
351   bool GetSnapshotAsync(Eina_Rectangle rect, Evas* canvas, Ewk_Web_App_Screenshot_Captured_Callback callback, void* user_data);
352   void InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision);
353   void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
354       NavigationPolicyParams params, bool* handled);
355   void UseSettingsFont();
356
357   _Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
358   Eina_Bool AsyncRequestHitTestDataAt(int x, int y,
359       Ewk_Hit_Test_Mode mode,
360       Ewk_View_Hit_Test_Request_Callback,
361       void* user_data);
362   _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
363       Ewk_Hit_Test_Mode mode);
364   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
365       Ewk_Hit_Test_Mode mode,
366       Ewk_View_Hit_Test_Request_Callback,
367       void* user_data);
368   void DispatchAsyncHitTestData(const Hit_Test_Params& params, int64_t request_id);
369   void UpdateHitTestData(const Hit_Test_Params& params);
370
371   int current_find_request_id() const { return current_find_request_id_; }
372   bool PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
373   void InvokePlainTextGetCallback(const std::string& content_text, int plain_text_get_callback_id);
374   int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
375   void SetViewGeolocationPermissionCallback(Ewk_View_Geolocation_Permission_Callback callback, void* user_data);
376   bool InvokeViewGeolocationPermissionCallback(_Ewk_Geolocation_Permission_Request* geolocation_permission_request_context, Eina_Bool* result);
377   void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback, void* user_data);
378   bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction, 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, void *userData);
392   bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback, void *userData);
393   bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback, void *userData);
394   void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
395   void InvokeWebAppIconUrlGetCallback(const std::string &iconUrl, int callbackId);
396   void InvokeWebAppIconUrlsGetCallback(const std::map<std::string, std::string> &iconUrls, int callbackId);
397   void SetNotificationPermissionCallback(Ewk_View_Notification_Permission_Callback callback, void* user_data);
398   bool IsNotificationPermissionCallbackSet() const;
399   bool InvokeNotificationPermissionCallback(Ewk_Notification_Permission_Request* request);
400
401   bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
402   void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
403   bool IsFullscreen();
404   void ExitFullscreen();
405   double GetScale();
406   void DidChangePageScaleFactor(double scale_factor);
407   void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
408   void JavaScriptAlertReply();
409   void SetJavaScriptConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
410   void JavaScriptConfirmReply(bool result);
411   void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
412   void JavaScriptPromptReply(const char* result);
413   void set_renderer_crashed();
414   void GetPageScaleRange(double *min_scale, double *max_scale);
415   void DidChangePageScaleRange(double min_scale, double max_scale);
416   void SetDrawsTransparentBackground(bool enabled);
417   void GetSessionData(const char **data, unsigned *length) const;
418   bool RestoreFromSessionData(const char *data, unsigned length);
419   void ShowFileChooser(const content::FileChooserParams&);
420   void DidChangeContentsArea(int width, int height);
421   void SetBrowserFont();
422   void SetCertificatePem(const std::string& certificate);
423   bool IsDragging() const;
424
425   void RequestColorPicker(int r, int g, int b, int a);
426   void DismissColorPicker();
427   bool SetColorPickerColor(int r, int g, int b, int a);
428   void InputPickerShow(ui::TextInputType input_type, double input_value);
429   void OnSnapshot(const std::vector<unsigned char>& pixData, int width, int height, int snapshotId);
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(Ewk_Quota_Permission_Request_Callback callback,
444                                          void* user_data);
445   void InvokeQuotaPermissionRequest(_Ewk_Quota_Permission_Request* request,
446                                     const content::QuotaPermissionContext::PermissionCallback& cb);
447   void QuotaRequestReply(const _Ewk_Quota_Permission_Request *request,
448                          bool allow);
449   void QuotaRequestCancel(const _Ewk_Quota_Permission_Request *request);
450
451   void SetViewMode(blink::WebViewMode view_mode);
452
453   gfx::Point GetContextMenuPosition() const;
454
455   content::ContextMenuControllerEfl* GetContextMenuController() {
456     return context_menu_.get();
457   }
458   void ResetContextMenuController();
459
460   /// ---- Event handling
461   bool HandleShow();
462   bool HandleHide();
463   bool HandleMove(int x, int y);
464   bool HandleResize(int width, int height);
465   bool HandleTextSelectionDown(int x, int y);
466   bool HandleTextSelectionUp(int x, int y);
467
468   void HandleRendererProcessCrash();
469   void InvokeWebProcessCrashedCallback();
470   void HandlePostponedGesture(int x, int y, ui::EventType type);
471  private:
472   void InitializeContent();
473   void SendDelayedMessages(content::RenderViewHost* render_view_host);
474
475   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
476   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
477       Ewk_Hit_Test_Mode mode,
478       WebViewAsyncRequestHitTestDataCallback* cb);
479   void HandleLongPressGesture(int x, int y, Ewk_Hit_Test_Mode mode,
480       _Ewk_Hit_Test*);
481   void HandleTapGesture(int x, int y, Ewk_Hit_Test_Mode mode,
482       _Ewk_Hit_Test*);
483   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
484
485 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
486   static void cameraResultCb(service_h request, service_h reply,
487     service_result_e result, void* data);
488 #endif
489
490 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
491   bool LaunchCamera(base::string16 mimetype);
492 #endif
493   content::RenderWidgetHostViewEfl* rwhv() const;
494   JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
495
496   void ReleasePopupMenuList();
497
498   scoped_refptr<WebViewEvasEventHandler> evas_event_handler_;
499   scoped_refptr<Ewk_Context> context_;
500   scoped_refptr<Ewk_Context> old_context_;
501   scoped_ptr<content::WebContents> web_contents_;
502   scoped_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
503   std::string pending_url_request_;
504   scoped_ptr<Ewk_Settings> settings_;
505   scoped_ptr<_Ewk_Frame> frame_;
506   scoped_ptr<_Ewk_Policy_Decision> window_policy_;
507   Evas_Object* evas_object_;
508   Evas_Object* native_view_;
509   bool touch_events_enabled_;
510   bool mouse_events_enabled_;
511   double text_zoom_factor_;
512   mutable std::string selected_text_;
513   mutable std::string user_agent_;
514   mutable std::string user_agent_app_name_;
515   scoped_ptr<_Ewk_Auth_Challenge> auth_challenge_;
516
517   Eina_List* popupMenuItems_;
518   Popup_Picker* popupPicker_;
519   bool formIsNavigating_;
520   typedef struct {
521     int count;
522     int position;
523     bool prevState;
524     bool nextState;
525   } formNavigation;
526   formNavigation formNavigation_;
527   scoped_ptr<content::ContextMenuControllerEfl> context_menu_;
528   scoped_ptr<content::FileChooserControllerEfl> file_chooser_;
529   scoped_ptr<content::PopupControllerEfl> popup_controller_;
530   scoped_ptr<content::SelectionControllerEfl> selection_controller_;
531   base::string16 previous_text_;
532   int current_find_request_id_;
533   static int find_request_id_counter_;
534   IDMap<EwkViewPlainTextGetCallback, IDMapOwnPointer> plain_text_get_callback_map_;
535   gfx::Size contents_size_;
536   double progress_;
537   mutable std::string title_;
538   mutable std::string pem_certificate_;
539   Hit_Test_Params hit_test_params_;
540   base::WaitableEvent hit_test_completion_;
541   IDMap<MHTMLCallbackDetails, IDMapOwnPointer> mhtml_callback_map_;
542   double page_scale_factor_;
543   double min_page_scale_factor_;
544   double max_page_scale_factor_;
545   scoped_ptr<OrientationLockCallback> orientation_lock_callback_;
546   scoped_ptr<WebViewGeolocationPermissionCallback> geolocation_permission_cb_;
547   scoped_ptr<WebViewUnfocusAllowCallback> unfocus_allow_cb_;
548   scoped_ptr<content::InputPicker> inputPicker_;
549   IDMap<WebApplicationIconUrlGetCallback, IDMapOwnPointer> web_app_icon_url_get_callback_map_;
550   IDMap<WebApplicationIconUrlsGetCallback, IDMapOwnPointer> web_app_icon_urls_get_callback_map_;
551   IDMap<WebApplicationCapableGetCallback, IDMapOwnPointer> web_app_capable_get_callback_map_;
552   IDMap< WebAppScreenshotCapturedCallback, IDMapOwnPointer> screen_capture_cb_map_;
553   scoped_ptr<NotificationPermissionCallback> notification_permission_callback_;
554   content::DevToolsDelegateEfl* inspector_server_;
555   scoped_ptr<ScrollDetector> scroll_detector_;
556 #if defined(OS_TIZEN_MOBILE)
557   content::FileChooserParams::Mode filechooser_mode_;
558 #endif
559   std::map<const _Ewk_Quota_Permission_Request*, content::QuotaPermissionContext::PermissionCallback> quota_permission_request_map_;
560   scoped_ptr<QuotaPermissionRequestCallback> quota_request_callback_;
561   bool is_initialized_;
562
563   scoped_ptr<_Ewk_Back_Forward_List> back_forward_list_;
564
565   static content::WebContentsEflDelegate::WebContentsCreateCallback
566       create_new_window_web_contents_cb_;
567
568 private:
569   Eina_Bool AsyncRequestHitTestPrivate(
570       int x, int y, Ewk_Hit_Test_Mode mode,
571       AsyncHitTestRequest* asyncHitTestRequest);
572
573   gfx::Vector2d previous_scroll_position_;
574
575   gfx::Point context_menu_position_;
576
577   std::set<IPC::Message*> delayed_messages_;
578
579   std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
580 };
581
582 const unsigned int g_default_tilt_motion_sensitivity = 3;
583
584
585 #endif