Fix EWK content rendering support.
[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   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
241
242   tizen_webview::WebView* GetPublicWebView();
243 #if defined(EWK_REFACTOR)
244   tizen_webview::WebViewEvasEventHandler* GetEvasEventHandler() { return evas_event_handler_; }
245 #endif
246   tizen_webview::WebContext* context() const { return context_.get(); }
247   Evas_Object* evas_object() const { return evas_object_; }
248   Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
249   Evas_Object* GetContentImageObject() const;
250
251   content::WebContents& web_contents() const
252   {
253     return *web_contents_.get();
254   }
255
256   template<EWebViewCallbacks::CallbackType callbackType>
257   EWebViewCallbacks::CallBack<callbackType> SmartCallback() const
258   {
259     return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
260   }
261
262   void set_magnifier(bool status);
263
264   // ewk_view api
265   void SetURL(const char* url_string);
266   const char* GetURL() const;
267   void Reload();
268   void ReloadIgnoringCache();
269   Eina_Bool CanGoBack();
270   Eina_Bool CanGoForward();
271   Eina_Bool HasFocus() const;
272   void SetFocus(Eina_Bool focus);
273   Eina_Bool GoBack();
274   Eina_Bool GoForward();
275   void Suspend();
276   void Resume();
277   void Stop();
278   double GetTextZoomFactor() const;
279   void SetTextZoomFactor(double text_zoom_factor);
280   void ExecuteEditCommand(const char* command, const char* value);
281   void SetOrientation(int orientation);
282   void SetOrientationLockCallback(tizen_webview::Orientation_Lock_Cb func, void* data);
283   bool TouchEventsEnabled() const;
284   void SetTouchEventsEnabled(bool enabled);
285   bool MouseEventsEnabled() const;
286   void SetMouseEventsEnabled(bool enabled);
287   void Show();
288   void Hide();
289   bool ExecuteJavaScript(const char* script, tizen_webview::View_Script_Execute_Callback callback, void* userdata);
290   bool SetUserAgent(const char* userAgent);
291   bool SetUserAgentAppName(const char* application_name);
292   bool SetPrivateBrowsing(bool incognito);
293   bool GetPrivateBrowsing() const;
294   const char* GetUserAgent() const;
295   const char* GetUserAgentAppName() const;
296   const char* GetSelectedText() const;
297   bool IsLastAvailableTextEmpty() const;
298   Ewk_Settings* GetSettings();
299   tizen_webview::Frame* GetMainFrame();
300   void UpdateWebKitPreferences();
301   void LoadHTMLString(const char* html, const char* base_uri, const char* unreachable_uri);
302   void LoadPlainTextString(const char* plain_text);
303   void LoadData(const char* data, size_t size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri = NULL);
304   void InvokeLoadError(const tizen_webview::Error &error);
305   void InvokeAuthCallback(LoginDelegateEfl* login_delegate, const GURL& url, const std::string& realm);
306   void Find(const char* text, tizen_webview::Find_Options);
307   void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
308   void SetContentSecurityPolicy(const char* policy, tizen_webview::ContentSecurityPolicyType type);
309   void ShowPopupMenu(const gfx::Rect& rect, blink::TextDirection textDirection, double pageScaleFactor, const std::vector<content::MenuItem>& items, int data, int selectedIndex, bool multiple);
310   Eina_Bool HidePopupMenu();
311   void UpdateFormNavigation(int formElementCount, int currentNodeIndex,
312       bool prevState, bool nextState);
313   void FormNavigate(bool direction);
314   bool IsSelectPickerShown() const;
315   void CloseSelectPicker();
316   bool FormIsNavigating() const { return formIsNavigating_; }
317   void SetFormIsNavigating(bool formIsNavigating);
318   Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex);
319   Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
320   Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
321   Eina_Bool PopupMenuClose();
322   void ShowContextMenu(
323       const content::ContextMenuParams& params,
324       content::ContextMenuType type = content::MENU_TYPE_LINK,
325       bool show_selection = true);
326   void CancelContextMenu(int request_id);
327   void SetScale(double scale_factor, int x, int y);
328   bool GetScrollPosition(int* x, int* y) const;
329   void SetScroll(int x, int y);
330   void UrlRequestSet(const char* url,
331       content::NavigationController::LoadURLType loadtype,
332       Eina_Hash* headers,
333       const char* body);
334
335   content::SelectionControllerEfl* GetSelectionController() const { return selection_controller_.get(); }
336 #ifdef TIZEN_CONTENTS_DETECTION
337   content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); }
338 #endif
339   void SelectRange(const gfx::Point& start, const gfx::Point& end);
340   void MoveCaret(const gfx::Point& point);
341   void QuerySelectionStyle();
342   void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
343   void SelectClosestWord(const gfx::Point& touch_point);
344   void SelectLinkText(const gfx::Point& touch_point);
345   bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
346   void GetSnapShotForRect(gfx::Rect& rect);
347
348   // Callback OnCopyFromBackingStore will be called once we get the snapshot from render
349   void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
350
351   /**
352    * Creates a snapshot of given rectangle from EWebView
353    *
354    * @param rect rectangle of EWebView which will be taken into snapshot
355    *
356    * @return created snapshot or NULL if error occured.
357    * @note ownership of snapshot is passed to caller
358   */
359   Evas_Object* GetSnapshot(Eina_Rectangle rect);
360
361   bool GetSnapshotAsync(Eina_Rectangle rect, Evas* canvas, tizen_webview::Web_App_Screenshot_Captured_Callback callback, void* user_data);
362   void InvokePolicyResponseCallback(tizen_webview::PolicyDecision* policy_decision);
363   void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
364       NavigationPolicyParams params, bool* handled);
365   void UseSettingsFont();
366
367   tizen_webview::Hit_Test* RequestHitTestDataAt(int x, int y,
368       tizen_webview::Hit_Test_Mode mode);
369   Eina_Bool AsyncRequestHitTestDataAt(int x, int y,
370       tizen_webview::Hit_Test_Mode mode,
371       tizen_webview::View_Hit_Test_Request_Callback,
372       void* user_data);
373   tizen_webview::Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
374       tizen_webview::Hit_Test_Mode mode);
375   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
376       tizen_webview::Hit_Test_Mode mode,
377       tizen_webview::View_Hit_Test_Request_Callback,
378       void* user_data);
379   void DispatchAsyncHitTestData(const _Ewk_Hit_Test& hit_test_data, const NodeAttributesMap& node_attributes, int64_t request_id);
380   void UpdateHitTestData(const _Ewk_Hit_Test& hit_test_data, const NodeAttributesMap& node_attributes);
381
382   int current_find_request_id() const { return current_find_request_id_; }
383   bool PlainTextGet(tizen_webview::View_Plain_Text_Get_Callback callback, void* user_data);
384   void InvokePlainTextGetCallback(const std::string& content_text, int plain_text_get_callback_id);
385   int SetEwkViewPlainTextGetCallback(tizen_webview::View_Plain_Text_Get_Callback callback, void* user_data);
386   void SetViewGeolocationPermissionCallback(tizen_webview::View_Geolocation_Permission_Callback callback, void* user_data);
387   bool InvokeViewGeolocationPermissionCallback(void* geolocation_permission_request_context, Eina_Bool* result);
388   void SetViewUnfocusAllowCallback(tizen_webview::View_Unfocus_Allow_Callback callback, void* user_data);
389   bool InvokeViewUnfocusAllowCallback(tizen_webview::Unfocus_Direction direction, Eina_Bool* result);
390   void DidChangeContentsSize(int width, int height);
391   const Eina_Rectangle GetContentsSize() const;
392   void GetScrollSize(int* w, int* h);
393   void StopFinding();
394   void SetProgressValue(double progress);
395   double GetProgressValue();
396   const char* GetTitle();
397   bool SaveAsPdf(int width, int height, const std::string& file_name);
398   void BackForwardListClear();
399   tizen_webview::BackForwardList* GetBackForwardList() const;
400   void InvokeBackForwardListChangedCallback();
401   tizen_webview::BackForwardHistory* GetBackForwardHistory() const;
402   bool WebAppCapableGet(tizen_webview::Web_App_Capable_Get_Callback callback, void *userData);
403   bool WebAppIconUrlGet(tizen_webview::Web_App_Icon_URL_Get_Callback callback, void *userData);
404   bool WebAppIconUrlsGet(tizen_webview::Web_App_Icon_URLs_Get_Callback callback, void *userData);
405   void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
406   void InvokeWebAppIconUrlGetCallback(const std::string &iconUrl, int callbackId);
407   void InvokeWebAppIconUrlsGetCallback(const std::map<std::string, std::string> &iconUrls, int callbackId);
408   void SetNotificationPermissionCallback(tizen_webview::View_Notification_Permission_Callback callback, void* user_data);
409   bool IsNotificationPermissionCallbackSet() const;
410   bool InvokeNotificationPermissionCallback(tizen_webview::NotificationPermissionRequest* request);
411
412   bool GetMHTMLData(tizen_webview::View_MHTML_Data_Get_Callback callback, void* user_data);
413   void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
414   bool IsFullscreen();
415   void ExitFullscreen();
416   double GetScale();
417   void DidChangePageScaleFactor(double scale_factor);
418   void SetJavaScriptAlertCallback(tizen_webview::View_JavaScript_Alert_Callback callback, void* user_data);
419   void JavaScriptAlertReply();
420   void SetJavaScriptConfirmCallback(tizen_webview::View_JavaScript_Confirm_Callback callback, void* user_data);
421   void JavaScriptConfirmReply(bool result);
422   void SetJavaScriptPromptCallback(tizen_webview::View_JavaScript_Prompt_Callback callback, void* user_data);
423   void JavaScriptPromptReply(const char* result);
424   void set_renderer_crashed();
425   void GetPageScaleRange(double *min_scale, double *max_scale);
426   void DidChangePageScaleRange(double min_scale, double max_scale);
427   void SetDrawsTransparentBackground(bool enabled);
428   void GetSessionData(const char **data, unsigned *length) const;
429   bool RestoreFromSessionData(const char *data, unsigned length);
430   void ShowFileChooser(const content::FileChooserParams&);
431   void DidChangeContentsArea(int width, int height);
432   void SetBrowserFont();
433   void SetCertificatePem(const std::string& certificate);
434   bool IsDragging() const;
435
436   void RequestColorPicker(int r, int g, int b, int a);
437   void DismissColorPicker();
438   bool SetColorPickerColor(int r, int g, int b, int a);
439   void InputPickerShow(
440       ui::TextInputType input_type, double input_value);
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 HandleFocusIn();
474   bool HandleFocusOut();
475
476   bool HandleEvasEvent(const Evas_Event_Mouse_Down* event);
477   bool HandleEvasEvent(const Evas_Event_Mouse_Up* event);
478   bool HandleEvasEvent(const Evas_Event_Mouse_Move* event);
479   bool HandleEvasEvent(const Evas_Event_Mouse_Wheel* event);
480   bool HandleEvasEvent(const Evas_Event_Key_Down* event);
481   bool HandleEvasEvent(const Evas_Event_Key_Up* event);
482   bool HandleGesture(ui::GestureEvent* event);
483   bool HandleTouchEvent(ui::TouchEvent* event);
484   void HandleRendererProcessCrash();
485   void HandlePostponedGesture(int x, int y, ui::EventType type);
486  private:
487   void InitializeContent();
488   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
489   Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
490       tizen_webview::Hit_Test_Mode mode,
491       WebViewAsyncRequestHitTestDataCallback* cb);
492   void HandleLongPressGesture(int x, int y, tizen_webview::Hit_Test_Mode mode,
493       tizen_webview::Hit_Test*);
494   void HandleTapGesture(int x, int y, tizen_webview::Hit_Test_Mode mode,
495       tizen_webview::Hit_Test*);
496   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
497
498 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
499   static void cameraResultCb(service_h request, service_h reply,
500     service_result_e result, void* data);
501 #endif
502
503 #if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
504   bool LaunchCamera(base::string16 mimetype);
505 #endif
506   content::RenderWidgetHostViewEfl* rwhv() const;
507   JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
508
509 #if defined(OS_TIZEN)
510   void ReleasePopupMenuList();
511 #endif
512
513   tizen_webview::WebView* public_webview_;
514 #if defined(EWK_REFACTOR)
515   tizen_webview::WebViewEvasEventHandler* evas_event_handler_;
516 #endif
517   scoped_refptr<tizen_webview::WebContext> context_;
518   scoped_refptr<tizen_webview::WebContext> old_context_;
519   scoped_ptr<content::WebContents> web_contents_;
520   scoped_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
521   std::string pending_url_request_;
522   scoped_ptr<Ewk_Settings> settings_;
523   scoped_ptr<tizen_webview::Frame> frame_;
524   scoped_ptr<tizen_webview::PolicyDecision> window_policy_;
525   Evas_Object* evas_object_;
526   Evas_Object* native_view_;
527   bool touch_events_enabled_;
528   bool mouse_events_enabled_;
529   double text_zoom_factor_;
530   mutable std::string selected_text_;
531   mutable std::string user_agent_;
532   mutable std::string user_agent_app_name_;
533   scoped_ptr<_Ewk_Auth_Challenge> auth_challenge_;
534
535 #if defined(OS_TIZEN)
536   Eina_List* popupMenuItems_;
537   Popup_Picker* popupPicker_;
538 #endif
539   bool formIsNavigating_;
540   typedef struct {
541     int count;
542     int position;
543     bool prevState;
544     bool nextState;
545   } formNavigation;
546   formNavigation formNavigation_;
547   scoped_ptr<content::ContextMenuControllerEfl> context_menu_;
548   scoped_ptr<content::FileChooserControllerEfl> file_chooser_;
549 #ifdef TIZEN_CONTENTS_DETECTION
550   scoped_ptr<content::PopupControllerEfl> popup_controller_;
551 #endif
552   scoped_ptr<content::SelectionControllerEfl> selection_controller_;
553   base::string16 previous_text_;
554   int current_find_request_id_;
555   static int find_request_id_counter_;
556   IDMap<EwkViewPlainTextGetCallback, IDMapOwnPointer> plain_text_get_callback_map_;
557   gfx::Size contents_size_;
558   double progress_;
559   mutable std::string title_;
560   mutable std::string pem_certificate_;
561   _Ewk_Hit_Test hit_test_data_;
562   base::WaitableEvent hit_test_completion_;
563   IDMap<MHTMLCallbackDetails, IDMapOwnPointer> mhtml_callback_map_;
564   double page_scale_factor_;
565   double min_page_scale_factor_;
566   double max_page_scale_factor_;
567   scoped_ptr<OrientationLockCallback> orientation_lock_callback_;
568   scoped_ptr<WebViewGeolocationPermissionCallback> geolocation_permission_cb_;
569   scoped_ptr<WebViewUnfocusAllowCallback> unfocus_allow_cb_;
570   scoped_ptr<content::InputPicker> inputPicker_;
571   IDMap<WebApplicationIconUrlGetCallback, IDMapOwnPointer> web_app_icon_url_get_callback_map_;
572   IDMap<WebApplicationIconUrlsGetCallback, IDMapOwnPointer> web_app_icon_urls_get_callback_map_;
573   IDMap<WebApplicationCapableGetCallback, IDMapOwnPointer> web_app_capable_get_callback_map_;
574   IDMap< WebAppScreenshotCapturedCallback, IDMapOwnPointer> screen_capture_cb_map_;
575   scoped_ptr<NotificationPermissionCallback> notification_permission_callback_;
576   content::DevToolsDelegateEfl* inspector_server_;
577 #ifdef TIZEN_EDGE_EFFECT
578   scoped_refptr<EdgeEffect> edge_effect_;
579 #endif
580
581 #if defined(OS_TIZEN_MOBILE)
582   content::FileChooserParams::Mode filechooser_mode_;
583 #endif
584   bool is_initialized_;
585
586   scoped_ptr<tizen_webview::BackForwardList> back_forward_list_;
587
588   static content::WebContentsDelegate::WebContentsCreateCallback
589       create_new_window_web_contents_cb_;
590
591 private:
592   Eina_Bool AsyncRequestHitTestPrivate(
593       int x, int y, tizen_webview::Hit_Test_Mode mode,
594       AsyncHitTestRequest* asyncHitTestRequest);
595
596   gfx::Vector2d previous_scroll_position_;
597
598   gfx::Point context_menu_position_;
599
600   std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
601   // only tizen_webview::WebView can create and delete this
602   EWebView(tizen_webview::WebView* owner, tizen_webview::WebContext*, Evas_Object* smart_object);
603   ~EWebView();
604   friend class tizen_webview::WebView;
605   friend class tizen_webview::WebViewEvasEventHandler;
606 };
607
608 namespace tizen_webview {
609 typedef ::EWebView WebViewImpl;
610 };
611
612 const unsigned int g_default_tilt_motion_sensitivity = 3;
613
614
615 #endif