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