Remove tw_back_forward_list_impl.h and tw_back_forward_history.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 "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 "eweb_view_callbacks.h"
42 #include "selection_controller_efl.h"
43 #include "web_contents_delegate_efl.h"
44 #include "context_menu_controller_efl.h"
45 #include "file_chooser_controller_efl.h"
46 #include "ui/gfx/point.h"
47 #include "ui/gfx/size.h"
48 #include "browser/inputpicker/InputPicker.h"
49 #include "third_party/WebKit/Source/platform/text/TextDirection.h"
50 #include "tizen_webview/public/tw_hit_test.h"
51
52 #ifdef TIZEN_CONTENTS_DETECTION
53 #include "popup_controller_efl.h"
54 #endif
55
56 #ifdef TIZEN_EDGE_EFFECT
57 #include "EdgeEffect.h"
58 #endif
59
60 #if defined(OS_TIZEN)
61 #include "browser/selectpicker/popup_picker.h"
62 #endif
63
64 #include "tizen_webview/public/tw_hit_test.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
69 namespace content {
70 class RenderViewHost;
71 class RenderWidgetHostViewEfl;
72 class WebContentsDelegateEfl;
73 class ContextMenuControllerEfl;
74 class DevToolsDelegateEfl;
75 class WebContentsViewEfl;
76 #ifdef TIZEN_CONTENTS_DETECTION
77 class PopupControllerEfl;
78 #endif
79 }
80
81 namespace ui {
82 class GestureRecognizer;
83 class GestureEvent;
84 class TouchEvent;
85 }
86
87 namespace tizen_webview {
88 class Hit_Test;
89 class WebContext;
90 class WebView;
91 class WebViewDelegate;
92 class WebViewEvasEventHandler;
93 class PolicyDecision;
94 class Error;
95 }
96
97 class WebAppScreenshotCapturedCallback : public base::RefCounted<WebAppScreenshotCapturedCallback> {
98  public:
99       WebAppScreenshotCapturedCallback(tizen_webview::Web_App_Screenshot_Captured_Callback func, void *user_data, Evas* canvas)
100           : func_(func), user_data_(user_data), canvas_(canvas) {}
101   void Run(Evas_Object* image) {
102     if (func_ != NULL)
103       (func_)(image, user_data_);
104   }
105
106  private:
107   tizen_webview::Web_App_Screenshot_Captured_Callback func_;
108   void *user_data_;
109   Evas* canvas_;
110 };
111
112 class EwkViewPlainTextGetCallback {
113  public:
114   EwkViewPlainTextGetCallback(tizen_webview::View_Plain_Text_Get_Callback callback,
115                               void* user_data)
116     : callback_(callback), user_data_(user_data)
117     { }
118   void TriggerCallback(Evas_Object* obj, const std::string& content_text);
119
120  private:
121   tizen_webview::View_Plain_Text_Get_Callback callback_;
122   void* user_data_;
123 };
124
125 class OrientationLockCallback {
126  public:
127   OrientationLockCallback(tizen_webview::Orientation_Lock_Cb lock,
128                           void* user_data)
129     : lock_(lock),
130       user_data_(user_data)
131     {}
132   private:
133     tizen_webview::Orientation_Lock_Cb lock_;
134     void* user_data_;
135 };
136
137 class MHTMLCallbackDetails {
138  public:
139   MHTMLCallbackDetails(tizen_webview::View_MHTML_Data_Get_Callback callback_func, void *user_data)
140     : callback_func_(callback_func),
141       user_data_(user_data)
142   {}
143   void Run(Evas_Object* obj, const std::string& mhtml_content);
144
145   tizen_webview::View_MHTML_Data_Get_Callback callback_func_;
146   void *user_data_;
147 };
148
149 class WebApplicationIconUrlGetCallback {
150  public:
151   WebApplicationIconUrlGetCallback(tizen_webview::Web_App_Icon_URL_Get_Callback func, void *user_data)
152     : func_(func), user_data_(user_data)
153   {}
154   void Run(const std::string &url) {
155     if (func_) {
156       (func_)(url.c_str(), user_data_);
157     }
158   }
159
160  private:
161   tizen_webview::Web_App_Icon_URL_Get_Callback func_;
162   void *user_data_;
163 };
164
165 class WebApplicationIconUrlsGetCallback {
166  public:
167   WebApplicationIconUrlsGetCallback(tizen_webview::Web_App_Icon_URLs_Get_Callback func, void *user_data)
168     : func_(func), user_data_(user_data)
169   {}
170   void Run(const std::map<std::string, std::string> &urls) {
171     if (func_) {
172       Eina_List *list = NULL;
173       for (std::map<std::string, std::string>::const_iterator it = urls.begin(); it != urls.end(); ++it) {
174         _Ewk_Web_App_Icon_Data *data = ewkWebAppIconDataCreate(it->first, it->second);
175         list = eina_list_append(list, data);
176       }
177       (func_)(list, user_data_);
178     }
179   }
180
181  private:
182   tizen_webview::Web_App_Icon_URLs_Get_Callback func_;
183   void *user_data_;
184 };
185
186 class WebApplicationCapableGetCallback {
187  public:
188   WebApplicationCapableGetCallback(tizen_webview::Web_App_Capable_Get_Callback func, void *user_data)
189     : func_(func), user_data_(user_data)
190   {}
191   void Run(bool capable) {
192     if (func_) {
193       (func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
194     }
195   }
196
197  private:
198   tizen_webview::Web_App_Capable_Get_Callback func_;
199   void *user_data_;
200 };
201
202 class AsyncHitTestRequest;
203 class NotificationPermissionCallback {
204  public:
205   NotificationPermissionCallback(
206       Evas_Object* obj,
207       tizen_webview::View_Notification_Permission_Callback func,
208       void* user_data)
209       : obj_(obj), func_(func), user_data_(user_data) {}
210   bool Run(Ewk_Notification_Permission_Request* request) {
211     if (func_) {
212       return (func_)(obj_, request, user_data_) == EINA_TRUE;
213     }
214     return false;
215   }
216
217 private:
218   Evas_Object* obj_;
219   tizen_webview::View_Notification_Permission_Callback func_;
220   void* user_data_;
221 };
222
223 class WebViewAsyncRequestHitTestDataCallback;
224 class JavaScriptDialogManagerEfl;
225 class WebViewGeolocationPermissionCallback;
226 class WebViewUnfocusAllowCallback;
227
228 class EWebView {
229  public:
230   static EWebView* FromEvasObject(Evas_Object* eo);
231   static int GetOrientation();
232
233   // initialize data members and activate event handlers.
234   // call this once after created and before use
235   void Initialize();
236
237   void CreateNewWindow(content::WebContentsDelegate::WebContentsCreateCallback);
238   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
239
240   tizen_webview::WebView* GetPublicWebView();
241   tizen_webview::WebContext* context() const { return context_.get(); }
242   Evas_Object* evas_object() const { return evas_object_; }
243   Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
244
245   content::WebContents& web_contents() const
246   {
247     return *web_contents_.get();
248   }
249
250   template<EWebViewCallbacks::CallbackType callbackType>
251   EWebViewCallbacks::CallBack<callbackType> SmartCallback() const
252   {
253     return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
254   }
255
256   void set_magnifier(bool status);
257
258   // ewk_view api
259   void SetURL(const char* url_string);
260   const char* GetURL() const;
261   void Reload();
262   void ReloadIgnoringCache();
263   Eina_Bool CanGoBack();
264   Eina_Bool CanGoForward();
265   Eina_Bool HasFocus() const;
266   void SetFocus(Eina_Bool focus);
267   Eina_Bool GoBack();
268   Eina_Bool GoForward();
269   void Suspend();
270   void Resume();
271   void Stop();
272   double GetTextZoomFactor() const;
273   void SetTextZoomFactor(double text_zoom_factor);
274   void ExecuteEditCommand(const char* command, const char* value);
275   void SetOrientation(int orientation);
276   void SetOrientationLockCallback(tizen_webview::Orientation_Lock_Cb func, void* data);
277   bool TouchEventsEnabled() const;
278   void SetTouchEventsEnabled(bool enabled);
279   bool MouseEventsEnabled() const;
280   void SetMouseEventsEnabled(bool enabled);
281   void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
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   _Ewk_Back_Forward_List* GetBackForwardList() const;
396   void InvokeBackForwardListChangedCallback();
397   _Ewk_History* 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<_Ewk_Back_Forward_List> 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