Remove various enums in tizen_webview/public
[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/web_contents_delegate.h"
30 #include "content/public/common/menu_item.h"
31 #include "base/id_map.h"
32 #include "context_menu_controller_efl.h"
33 #include "eweb_context.h"
34 #include "ewk_touch.h"
35 #include "private/ewk_history_private.h"
36 #include "private/ewk_hit_test_private.h"
37 #include "private/ewk_auth_challenge_private.h"
38 #include "private/ewk_back_forward_list_private.h"
39 #include "private/ewk_settings_private.h"
40 #include "private/ewk_web_application_icon_data_private.h"
41 #include "public/ewk_view.h"
42 #include "eweb_view_callbacks.h"
43 #include "selection_controller_efl.h"
44 #include "web_contents_delegate_efl.h"
45 #include "context_menu_controller_efl.h"
46 #include "file_chooser_controller_efl.h"
47 #include "ui/gfx/point.h"
48 #include "ui/gfx/size.h"
49 #include "browser/inputpicker/InputPicker.h"
50 #include "third_party/WebKit/Source/platform/text/TextDirection.h"
51 #include "tizen_webview/public/tw_hit_test.h"
52
53 #ifdef TIZEN_CONTENTS_DETECTION
54 #include "popup_controller_efl.h"
55 #endif
56
57 #if defined(OS_TIZEN)
58 #include "browser/selectpicker/popup_picker.h"
59 #endif
60
61 #include "tizen_webview/public/tw_hit_test.h"
62 #include "tizen_webview/public/tw_callbacks.h"
63
64 namespace content {
65 class RenderViewHost;
66 class RenderWidgetHostViewEfl;
67 class WebContentsDelegateEfl;
68 class ContextMenuControllerEfl;
69 class DevToolsDelegateEfl;
70 class WebContentsViewEfl;
71 #ifdef TIZEN_CONTENTS_DETECTION
72 class PopupControllerEfl;
73 #endif
74 }
75
76 namespace ui {
77 class GestureRecognizer;
78 class GestureEvent;
79 class TouchEvent;
80 }
81
82 namespace tizen_webview {
83 class Hit_Test;
84 class WebContext;
85 class WebView;
86 class WebViewDelegate;
87 class WebViewEvasEventHandler;
88 class PolicyDecision;
89 class Error;
90 }
91
92 class WebAppScreenshotCapturedCallback : public base::RefCounted<WebAppScreenshotCapturedCallback> {
93  public:
94       WebAppScreenshotCapturedCallback(tizen_webview::Web_App_Screenshot_Captured_Callback func, void *user_data, Evas* canvas)
95           : func_(func), user_data_(user_data), canvas_(canvas) {}
96   void Run(Evas_Object* image) {
97     if (func_ != NULL)
98       (func_)(image, user_data_);
99   }
100
101  private:
102   tizen_webview::Web_App_Screenshot_Captured_Callback func_;
103   void *user_data_;
104   Evas* canvas_;
105 };
106
107 class EwkViewPlainTextGetCallback {
108  public:
109   EwkViewPlainTextGetCallback(tizen_webview::View_Plain_Text_Get_Callback callback,
110                               void* user_data)
111     : callback_(callback), user_data_(user_data)
112     { }
113   void TriggerCallback(Evas_Object* obj, const std::string& content_text);
114
115  private:
116   tizen_webview::View_Plain_Text_Get_Callback callback_;
117   void* user_data_;
118 };
119
120 class OrientationLockCallback {
121  public:
122   OrientationLockCallback(tizen_webview::Orientation_Lock_Cb lock,
123                           void* user_data)
124     : lock_(lock),
125       user_data_(user_data)
126     {}
127   private:
128     tizen_webview::Orientation_Lock_Cb lock_;
129     void* user_data_;
130 };
131
132 class MHTMLCallbackDetails {
133  public:
134   MHTMLCallbackDetails(tizen_webview::View_MHTML_Data_Get_Callback callback_func, void *user_data)
135     : callback_func_(callback_func),
136       user_data_(user_data)
137   {}
138   void Run(Evas_Object* obj, const std::string& mhtml_content);
139
140   tizen_webview::View_MHTML_Data_Get_Callback callback_func_;
141   void *user_data_;
142 };
143
144 class WebApplicationIconUrlGetCallback {
145  public:
146   WebApplicationIconUrlGetCallback(tizen_webview::Web_App_Icon_URL_Get_Callback func, void *user_data)
147     : func_(func), user_data_(user_data)
148   {}
149   void Run(const std::string &url) {
150     if (func_) {
151       (func_)(url.c_str(), user_data_);
152     }
153   }
154
155  private:
156   tizen_webview::Web_App_Icon_URL_Get_Callback func_;
157   void *user_data_;
158 };
159
160 class WebApplicationIconUrlsGetCallback {
161  public:
162   WebApplicationIconUrlsGetCallback(tizen_webview::Web_App_Icon_URLs_Get_Callback func, void *user_data)
163     : func_(func), user_data_(user_data)
164   {}
165   void Run(const std::map<std::string, std::string> &urls) {
166     if (func_) {
167       Eina_List *list = NULL;
168       for (std::map<std::string, std::string>::const_iterator it = urls.begin(); it != urls.end(); ++it) {
169         _Ewk_Web_App_Icon_Data *data = ewkWebAppIconDataCreate(it->first, it->second);
170         list = eina_list_append(list, data);
171       }
172       (func_)(list, user_data_);
173     }
174   }
175
176  private:
177   tizen_webview::Web_App_Icon_URLs_Get_Callback func_;
178   void *user_data_;
179 };
180
181 class WebApplicationCapableGetCallback {
182  public:
183   WebApplicationCapableGetCallback(tizen_webview::Web_App_Capable_Get_Callback func, void *user_data)
184     : func_(func), user_data_(user_data)
185   {}
186   void Run(bool capable) {
187     if (func_) {
188       (func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
189     }
190   }
191
192  private:
193   tizen_webview::Web_App_Capable_Get_Callback func_;
194   void *user_data_;
195 };
196
197 class AsyncHitTestRequest;
198 class NotificationPermissionCallback {
199  public:
200   NotificationPermissionCallback(
201       Evas_Object* obj,
202       tizen_webview::View_Notification_Permission_Callback func,
203       void* user_data)
204       : obj_(obj), func_(func), user_data_(user_data) {}
205   bool Run(Ewk_Notification_Permission_Request* request) {
206     if (func_) {
207       return (func_)(obj_, request, user_data_) == EINA_TRUE;
208     }
209     return false;
210   }
211
212 private:
213   Evas_Object* obj_;
214   tizen_webview::View_Notification_Permission_Callback func_;
215   void* user_data_;
216 };
217
218 class WebViewAsyncRequestHitTestDataCallback;
219 class JavaScriptDialogManagerEfl;
220 class WebViewGeolocationPermissionCallback;
221 class WebViewUnfocusAllowCallback;
222
223 class EWebView {
224  public:
225   static EWebView* FromEvasObject(Evas_Object* eo);
226   static int GetOrientation();
227
228   // initialize data members and activate event handlers.
229   // call this once after created and before use
230   void Initialize();
231
232   void CreateNewWindow(content::WebContentsDelegate::WebContentsCreateCallback);
233   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
234
235   tizen_webview::WebView* GetPublicWebView();
236   tizen_webview::WebContext* 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(tizen_webview::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, tizen_webview::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   bool IsLastAvailableTextEmpty() const;
288   Ewk_Settings* GetSettings();
289   _Ewk_Frame* GetMainFrame();
290   void UpdateWebKitPreferences();
291   void LoadHTMLString(const char* html, const char* base_uri, const char* unreachable_uri);
292   void LoadPlainTextString(const char* plain_text);
293   void LoadData(const char* data, size_t size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri = NULL);
294   void InvokeLoadError(const tizen_webview::Error &error);
295   void InvokeAuthCallback(LoginDelegateEfl* login_delegate, const GURL& url, const std::string& realm);
296   void Find(const char* text, Ewk_Find_Options);
297   void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
298   void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
299   void ShowPopupMenu(const std::vector<content::MenuItem>& items,
300                      int selectedIndex, bool multiple);
301   Eina_Bool HidePopupMenu();
302   void UpdateFormNavigation(int formElementCount, int currentNodeIndex,
303       bool prevState, bool nextState);
304   void FormNavigate(bool direction);
305   bool IsSelectPickerShown() const;
306   void CloseSelectPicker();
307   bool FormIsNavigating() const { return formIsNavigating_; }
308   void SetFormIsNavigating(bool formIsNavigating);
309   Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex);
310   Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
311   Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
312   Eina_Bool PopupMenuClose();
313   void ShowContextMenu(
314       const content::ContextMenuParams& params,
315       content::ContextMenuType type = content::MENU_TYPE_LINK,
316       bool show_selection = true);
317   void CancelContextMenu(int request_id);
318   void SetScale(double scale_factor, int x, int y);
319   bool GetScrollPosition(int* x, int* y) const;
320   void SetScroll(int x, int y);
321   void UrlRequestSet(const char* url,
322       content::NavigationController::LoadURLType loadtype,
323       Eina_Hash* headers,
324       const char* body);
325
326   content::SelectionControllerEfl* GetSelectionController() const { return selection_controller_.get(); }
327 #ifdef TIZEN_CONTENTS_DETECTION
328   content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); }
329 #endif
330   void SelectRange(const gfx::Point& start, const gfx::Point& end);
331   void MoveCaret(const gfx::Point& point);
332   void QuerySelectionStyle();
333   void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
334   void SelectClosestWord(const gfx::Point& touch_point);
335   void SelectLinkText(const gfx::Point& touch_point);
336   bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
337   void GetSnapShotForRect(gfx::Rect& rect);
338
339   // Callback OnCopyFromBackingStore will be called once we get the snapshot from render
340   void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
341
342   /**
343    * Creates a snapshot of given rectangle from EWebView
344    *
345    * @param rect rectangle of EWebView which will be taken into snapshot
346    *
347    * @return created snapshot or NULL if error occured.
348    * @note ownership of snapshot is passed to caller
349   */
350   Evas_Object* GetSnapshot(Eina_Rectangle rect);
351
352   bool GetSnapshotAsync(Eina_Rectangle rect, Evas* canvas, tizen_webview::Web_App_Screenshot_Captured_Callback callback, void* user_data);
353   void InvokePolicyResponseCallback(tizen_webview::PolicyDecision* policy_decision);
354   void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
355       NavigationPolicyParams params, bool* handled);
356   void UseSettingsFont();
357
358   tizen_webview::Hit_Test* RequestHitTestDataAt(int x, int y,
359       tizen_webview::Hit_Test_Mode mode);
360   Eina_Bool AsyncRequestHitTestDataAt(int x, int y,
361       tizen_webview::Hit_Test_Mode mode,
362       tizen_webview::View_Hit_Test_Request_Callback,
363       void* user_data);
364   tizen_webview::Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
365       tizen_webview::Hit_Test_Mode mode);
366   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
367       tizen_webview::Hit_Test_Mode mode,
368       tizen_webview::View_Hit_Test_Request_Callback,
369       void* user_data);
370   void DispatchAsyncHitTestData(const _Ewk_Hit_Test& hit_test_data, const NodeAttributesMap& node_attributes, int64_t request_id);
371   void UpdateHitTestData(const _Ewk_Hit_Test& hit_test_data, const NodeAttributesMap& node_attributes);
372
373   int current_find_request_id() const { return current_find_request_id_; }
374   bool PlainTextGet(tizen_webview::View_Plain_Text_Get_Callback callback, void* user_data);
375   void InvokePlainTextGetCallback(const std::string& content_text, int plain_text_get_callback_id);
376   int SetEwkViewPlainTextGetCallback(tizen_webview::View_Plain_Text_Get_Callback callback, void* user_data);
377   void SetViewGeolocationPermissionCallback(tizen_webview::View_Geolocation_Permission_Callback callback, void* user_data);
378   bool InvokeViewGeolocationPermissionCallback(void* geolocation_permission_request_context, Eina_Bool* result);
379   void SetViewUnfocusAllowCallback(tizen_webview::View_Unfocus_Allow_Callback callback, void* user_data);
380   bool InvokeViewUnfocusAllowCallback(tizen_webview::Unfocus_Direction direction, Eina_Bool* result);
381   void DidChangeContentsSize(int width, int height);
382   const Eina_Rectangle GetContentsSize() const;
383   void GetScrollSize(int* w, int* h);
384   void StopFinding();
385   void SetProgressValue(double progress);
386   double GetProgressValue();
387   const char* GetTitle();
388   bool SaveAsPdf(int width, int height, const std::string& file_name);
389   void BackForwardListClear();
390   _Ewk_Back_Forward_List* GetBackForwardList() const;
391   void InvokeBackForwardListChangedCallback();
392   _Ewk_History* GetBackForwardHistory() const;
393   bool WebAppCapableGet(tizen_webview::Web_App_Capable_Get_Callback callback, void *userData);
394   bool WebAppIconUrlGet(tizen_webview::Web_App_Icon_URL_Get_Callback callback, void *userData);
395   bool WebAppIconUrlsGet(tizen_webview::Web_App_Icon_URLs_Get_Callback callback, void *userData);
396   void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
397   void InvokeWebAppIconUrlGetCallback(const std::string &iconUrl, int callbackId);
398   void InvokeWebAppIconUrlsGetCallback(const std::map<std::string, std::string> &iconUrls, int callbackId);
399   void SetNotificationPermissionCallback(tizen_webview::View_Notification_Permission_Callback callback, void* user_data);
400   bool IsNotificationPermissionCallbackSet() const;
401   bool InvokeNotificationPermissionCallback(Ewk_Notification_Permission_Request* request);
402
403   bool GetMHTMLData(tizen_webview::View_MHTML_Data_Get_Callback callback, void* user_data);
404   void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
405   bool IsFullscreen();
406   void ExitFullscreen();
407   double GetScale();
408   void DidChangePageScaleFactor(double scale_factor);
409   void SetJavaScriptAlertCallback(tizen_webview::View_JavaScript_Alert_Callback callback, void* user_data);
410   void JavaScriptAlertReply();
411   void SetJavaScriptConfirmCallback(tizen_webview::View_JavaScript_Confirm_Callback callback, void* user_data);
412   void JavaScriptConfirmReply(bool result);
413   void SetJavaScriptPromptCallback(tizen_webview::View_JavaScript_Prompt_Callback callback, 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 DidChangePageScaleRange(double min_scale, double max_scale);
418   void SetDrawsTransparentBackground(bool enabled);
419   void GetSessionData(const char **data, unsigned *length) const;
420   bool RestoreFromSessionData(const char *data, unsigned length);
421   void ShowFileChooser(const content::FileChooserParams&);
422   void DidChangeContentsArea(int width, int height);
423   void SetBrowserFont();
424   void SetCertificatePem(const std::string& certificate);
425   bool IsDragging() const;
426
427   void RequestColorPicker(int r, int g, int b, int a);
428   void DismissColorPicker();
429   bool SetColorPickerColor(int r, int g, int b, int a);
430 #if defined(OS_TIZEN)
431   void InputPickerShow(
432       ui::TextInputType input_type, std::string input_value);
433 #else
434   void InputPickerShow(ui::TextInputType input_type, double input_value);
435 #endif
436   void OnSnapshot(const std::vector<unsigned char>& pixData, int width, int height, int snapshotId);
437
438 #ifdef TIZEN_CONTENTS_DETECTION
439   void ShowContentsDetectedPopup(const char*);
440 #endif
441
442   bool IsIMEShow();
443   gfx::Rect GetIMERect();
444   void ScrollFocusedEditableNode();
445
446   // Returns TCP port number with Inspector, or 0 if error.
447   int StartInspectorServer(int port = 0);
448   bool StopInspectorServer();
449
450   void LoadNotFoundErrorPage(const std::string& invalidUrl);
451   static std::string GetPlatformLocale();
452   bool GetLinkMagnifierEnabled() const;
453   void SetLinkMagnifierEnabled(bool enabled);
454
455   void SetOverrideEncoding(const std::string& encoding);
456   void SetViewMode(blink::WebViewMode view_mode);
457
458   gfx::Point GetContextMenuPosition() const;
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 HandlePostponedGesture(int x, int y, ui::EventType type);
470  private:
471   void InitializeContent();
472   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
473   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
474       tizen_webview::Hit_Test_Mode mode,
475       WebViewAsyncRequestHitTestDataCallback* cb);
476   void HandleLongPressGesture(int x, int y, tizen_webview::Hit_Test_Mode mode,
477       tizen_webview::Hit_Test*);
478   void HandleTapGesture(int x, int y, tizen_webview::Hit_Test_Mode mode,
479       tizen_webview::Hit_Test*);
480   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
481
482 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
483   static void cameraResultCb(service_h request, service_h reply,
484     service_result_e result, void* data);
485 #endif
486
487 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
488   bool LaunchCamera(base::string16 mimetype);
489 #endif
490   content::RenderWidgetHostViewEfl* rwhv() const;
491   JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
492
493 #if defined(OS_TIZEN)
494   void ReleasePopupMenuList();
495 #endif
496
497   tizen_webview::WebView* public_webview_;
498   scoped_refptr<tizen_webview::WebContext> context_;
499   scoped_refptr<tizen_webview::WebContext> old_context_;
500   scoped_ptr<content::WebContents> web_contents_;
501   scoped_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
502   std::string pending_url_request_;
503   scoped_ptr<Ewk_Settings> settings_;
504   scoped_ptr<_Ewk_Frame> frame_;
505   scoped_ptr<tizen_webview::PolicyDecision> window_policy_;
506   Evas_Object* evas_object_;
507   Evas_Object* native_view_;
508   bool touch_events_enabled_;
509   bool mouse_events_enabled_;
510   double text_zoom_factor_;
511   mutable std::string selected_text_;
512   mutable std::string user_agent_;
513   mutable std::string user_agent_app_name_;
514   scoped_ptr<_Ewk_Auth_Challenge> auth_challenge_;
515
516 #if defined(OS_TIZEN)
517   Eina_List* popupMenuItems_;
518   Popup_Picker* popupPicker_;
519 #endif
520   bool formIsNavigating_;
521   typedef struct {
522     int count;
523     int position;
524     bool prevState;
525     bool nextState;
526   } formNavigation;
527   formNavigation formNavigation_;
528   scoped_ptr<content::ContextMenuControllerEfl> context_menu_;
529   scoped_ptr<content::FileChooserControllerEfl> file_chooser_;
530 #ifdef TIZEN_CONTENTS_DETECTION
531   scoped_ptr<content::PopupControllerEfl> popup_controller_;
532 #endif
533   scoped_ptr<content::SelectionControllerEfl> selection_controller_;
534   base::string16 previous_text_;
535   int current_find_request_id_;
536   static int find_request_id_counter_;
537   IDMap<EwkViewPlainTextGetCallback, IDMapOwnPointer> plain_text_get_callback_map_;
538   gfx::Size contents_size_;
539   double progress_;
540   mutable std::string title_;
541   mutable std::string pem_certificate_;
542   _Ewk_Hit_Test hit_test_data_;
543   base::WaitableEvent hit_test_completion_;
544   IDMap<MHTMLCallbackDetails, IDMapOwnPointer> mhtml_callback_map_;
545   double page_scale_factor_;
546   double min_page_scale_factor_;
547   double max_page_scale_factor_;
548   scoped_ptr<OrientationLockCallback> orientation_lock_callback_;
549   scoped_ptr<WebViewGeolocationPermissionCallback> geolocation_permission_cb_;
550   scoped_ptr<WebViewUnfocusAllowCallback> unfocus_allow_cb_;
551   scoped_ptr<content::InputPicker> inputPicker_;
552   IDMap<WebApplicationIconUrlGetCallback, IDMapOwnPointer> web_app_icon_url_get_callback_map_;
553   IDMap<WebApplicationIconUrlsGetCallback, IDMapOwnPointer> web_app_icon_urls_get_callback_map_;
554   IDMap<WebApplicationCapableGetCallback, IDMapOwnPointer> web_app_capable_get_callback_map_;
555   IDMap< WebAppScreenshotCapturedCallback, IDMapOwnPointer> screen_capture_cb_map_;
556   scoped_ptr<NotificationPermissionCallback> notification_permission_callback_;
557   content::DevToolsDelegateEfl* inspector_server_;
558
559 #if defined(OS_TIZEN_MOBILE)
560   content::FileChooserParams::Mode filechooser_mode_;
561 #endif
562   bool is_initialized_;
563
564   scoped_ptr<_Ewk_Back_Forward_List> back_forward_list_;
565
566   static content::WebContentsDelegate::WebContentsCreateCallback
567       create_new_window_web_contents_cb_;
568
569 private:
570   Eina_Bool AsyncRequestHitTestPrivate(
571       int x, int y, tizen_webview::Hit_Test_Mode mode,
572       AsyncHitTestRequest* asyncHitTestRequest);
573
574   gfx::Vector2d previous_scroll_position_;
575
576   gfx::Point context_menu_position_;
577
578   std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
579   // only tizen_webview::WebView can create and delete this
580   EWebView(tizen_webview::WebView* owner, tizen_webview::WebContext*, Evas_Object* smart_object);
581   ~EWebView();
582   friend class tizen_webview::WebView;
583   friend class tizen_webview::WebViewEvasEventHandler;
584 };
585
586 namespace tizen_webview {
587 typedef ::EWebView WebViewImpl;
588 };
589
590 const unsigned int g_default_tilt_motion_sensitivity = 3;
591
592
593 #endif