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