[M120 Migration]URL of _Ewk_Error set wrong
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / eweb_view.h
old mode 100755 (executable)
new mode 100644 (file)
index 29c9703..08fc8e7
@@ -5,31 +5,25 @@
 #ifndef EWEB_VIEW_H
 #define EWEB_VIEW_H
 
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
-// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to
-// include instead.
-#include <appcore-agent/service_app.h>
-#endif
-
 #include <map>
 #include <string>
 #include <Evas.h>
 #include <locale.h>
 #include <vector>
 
-#include "base/callback.h"
 #include "base/containers/id_map.h"
+#include "base/functional/callback.h"
 #include "base/synchronization/waitable_event.h"
 #include "browser/input_picker/input_picker.h"
-#include "browser/selectpicker/popup_picker.h"
-#include "content/browser/date_time_chooser_efl.h"
-#include "content/browser/renderer_host/event_with_latency_info.h"
+#include "content/browser/select_picker/select_picker_base.h"
 #include "content/browser/selection/selection_controller_efl.h"
+#include "content/browser/web_contents/web_contents_view_aura.h"
+#include "content/browser/web_contents/web_contents_view_aura_helper_efl.h"
+#include "content/common/input/event_with_latency_info.h"
 #include "content/public/browser/context_menu_params.h"
 #include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/quota_permission_context.h"
 #include "content/public/browser/web_contents_delegate.h"
-#include "content/public/browser/web_contents_efl_delegate.h"
+#include "content/public/browser/webview_delegate.h"
 #include "content/public/common/input_event_ack_state.h"
 #include "content_browser_client_efl.h"
 #include "context_menu_controller_efl.h"
 #include "scroll_detector.h"
 #include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
 #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
+#include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
 #include "ui/aura/window_tree_host.h"
 #include "ui/gfx/geometry/point.h"
 #include "ui/gfx/geometry/size.h"
 #include "web_contents_delegate_efl.h"
+#if defined(TIZEN_PEPPER_EXTENSIONS)
+#include "ewk_extension_system_delegate.h"
+#include "public/ewk_value_product.h"
+#endif
+
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "third_party/blink/public/common/mediastream/media_devices.h"
+#endif
 
 namespace aura {
 namespace client {
@@ -62,6 +65,10 @@ class WindowParentingClient;
 }  // namespace client
 }  // namespace aura
 
+namespace base {
+class FilePath;
+}
+
 namespace content {
 class RenderFrameHost;
 class RenderViewHost;
@@ -70,17 +77,27 @@ class WebContentsDelegateEfl;
 class WebContentsViewAura;
 class ContextMenuControllerEfl;
 class PopupControllerEfl;
+class DateTimeChooserEfl;
 class InputPicker;
 class GinNativeBridgeDispatcherHost;
+class NavigationHandle;
 }
 
 class ErrorParams;
+class _Ewk_App_Control;
 class _Ewk_Policy_Decision;
 class _Ewk_Hit_Test;
 class Ewk_Context;
-class WebViewEvasEventHandler;
 class _Ewk_Quota_Permission_Request;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+struct _Ewk_File_Chooser_Request;
+#endif
+
+#if defined(TIZEN_ATK_SUPPORT)
+class EWebAccessibility;
+#endif
+
 template <typename CallbackPtr, typename CallbackParameter>
 class WebViewCallback {
  public:
@@ -114,6 +131,56 @@ class WebViewCallback {
   void* user_data_;
 };
 
+template <typename CallbackReturnValue,
+          typename CallbackPtr,
+          typename CallbackParameter>
+class WebViewCallbackWithReturnValue {
+ public:
+  WebViewCallbackWithReturnValue() { Set(nullptr, nullptr); }
+
+  void Set(CallbackPtr cb, void* data) {
+    callback_ = cb;
+    user_data_ = data;
+  }
+
+  /* LCOV_EXCL_START */
+  bool IsCallbackSet() const { return callback_; }
+
+  CallbackReturnValue Run(Evas_Object* webview, CallbackParameter param) {
+    if (IsCallbackSet())
+      return callback_(webview, param, user_data_);
+
+    return {};
+  }
+  /* LCOV_EXCL_STOP */
+
+ private:
+  CallbackPtr callback_;
+  void* user_data_;
+};
+
+template <typename CallbackPtr, typename... CallbackParameter>
+class WebViewErrorPageLoadCallback {
+ public:
+  WebViewErrorPageLoadCallback() { Set(nullptr, nullptr); }
+
+  void Set(CallbackPtr cb, void* data) {
+    callback_ = cb;
+    user_data_ = data;
+  }
+
+  bool IsCallbackSet() const { return callback_; }
+
+  void Run(Evas_Object* webview, CallbackParameter... param) {
+    if (IsCallbackSet())
+      callback_(webview, param..., user_data_);
+  }
+
+ private:
+  CallbackPtr callback_;
+  void* user_data_;
+};
+
 template <typename CallbackPtr, typename... CallbackParameter>
 class WebViewExceededQuotaCallback {
  public:
@@ -138,6 +205,22 @@ class WebViewExceededQuotaCallback {
   void* user_data_;
 };
 
+class BackgroundColorGetCallback {
+ public:
+  BackgroundColorGetCallback(Ewk_View_Background_Color_Get_Callback func,
+                             void* user_data)
+      : func_(func), user_data_(user_data) {}
+
+  void Run(Evas_Object* webview, int r, int g, int b, int a) {
+    if (func_)
+      func_(webview, r, g, b, a, user_data_);
+  }
+
+ private:
+  Ewk_View_Background_Color_Get_Callback func_;
+  void* user_data_;
+};
+
 class WebApplicationIconUrlGetCallback {
  public:
   WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func,
@@ -193,13 +276,70 @@ class WebApplicationCapableGetCallback {
   void* user_data_;
 };
 
+class DidChangeThemeColorCallback {
+ public:
+  DidChangeThemeColorCallback() : callback_(nullptr), user_data_(nullptr) {}
+  void Set(Ewk_View_Did_Change_Theme_Color_Callback callback, void* user_data) {
+    callback_ = callback;
+    user_data_ = user_data;
+  }
+  void Run(Evas_Object* o, const SkColor& color) {
+    if (callback_)
+      callback_(o, SkColorGetR(color), SkColorGetG(color), SkColorGetB(color),
+                SkColorGetA(color), user_data_);
+  }
+
+ private:
+  Ewk_View_Did_Change_Theme_Color_Callback callback_;
+  void* user_data_;
+};
+
+#if BUILDFLAG(IS_TIZEN_TV)
+class GetMediaDeviceCallback {
+ public:
+  GetMediaDeviceCallback() : func_(nullptr), user_data_(nullptr) {}
+
+  void Set(Ewk_Media_Device_List_Get_Callback func, void* user_data) {
+    func_ = func;
+    user_data_ = user_data;
+  }
+
+  void Run(EwkMediaDeviceInfo* device_list, int size) {
+    if (func_) {
+      (func_)(device_list, size, user_data_);
+    }
+  }
+
+ private:
+  Ewk_Media_Device_List_Get_Callback func_;
+  void* user_data_;
+};
+#endif
+
+#if BUILDFLAG(IS_TIZEN_TV)
+class IsVideoPlayingCallback {
+ public:
+  IsVideoPlayingCallback(Ewk_Is_Video_Playing_Callback func, void* user_data)
+      : func_(func), user_data_(user_data) {}
+  void Run(Evas_Object* obj, bool isplaying) {
+    if (func_) {
+      (func_)(obj, isplaying ? EINA_TRUE : EINA_FALSE, user_data_);
+    }
+  }
+
+ private:
+  Ewk_Is_Video_Playing_Callback func_;
+  void* user_data_;
+};
+#endif
+
 class WebViewAsyncRequestHitTestDataCallback;
 class JavaScriptDialogManagerEfl;
 class PermissionPopupManager;
 
 class EWebView {
  public:
-  static EWebView* FromEvasObject(Evas_Object* eo);
+  static EWebView* FromEwkView(Evas_Object* ewk_view);
 
   EWebView(Ewk_Context*, Evas_Object* smart_object);
   ~EWebView();
@@ -208,32 +348,36 @@ class EWebView {
   // call this once after created and before use
   void Initialize();
 
-  bool CreateNewWindow(
-      content::WebContentsEflDelegate::WebContentsCreateCallback);
+  bool CreateNewWindow(content::WebViewDelegate::WebContentsCreateCallback);
   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
 
   content::WebContentsViewAura* wcva() const;
   content::RenderWidgetHostViewAura* rwhva() const;
   Ewk_Context* context() const { return context_.get(); }
-  Evas_Object* evas_object() const { return evas_object_; }
-  Evas_Object* native_view() const { return native_view_; }
+  Evas_Object* ewk_view() const { return ewk_view_; }
+  Evas_Object* efl_main_layout() const { return efl_main_layout_; }
   Evas_Object* GetElmWindow() const;
-  Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
+  Evas* GetEvas() const { return evas_object_evas_get(ewk_view_); }
   PermissionPopupManager* GetPermissionPopupManager() const {
     return permission_popup_manager_.get();
   }
 
   content::WebContents& web_contents() const { return *web_contents_.get(); }
+  content::WebContentsViewAura* GetWebContentsViewAura() const;
+
+#if defined(TIZEN_ATK_SUPPORT)
+  EWebAccessibility& eweb_accessibility() const {
+    return *eweb_accessibility_.get();
+  }
+#endif
 
   template <EWebViewCallbacks::CallbackType callbackType>
   EWebViewCallbacks::CallBack<callbackType> SmartCallback() const {
-    return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
+    return EWebViewCallbacks::CallBack<callbackType>(ewk_view_);
   }
 
-  void set_magnifier(bool status);
-
   // ewk_view api
-  void SetURL(const GURL& url);
+  void SetURL(const GURL& url, bool from_api = false);
   const GURL& GetURL() const;
   const GURL& GetOriginalURL() const;
   void Reload();
@@ -247,17 +391,36 @@ class EWebView {
   void Suspend();
   void Resume();
   void Stop();
+#if BUILDFLAG(IS_TIZEN_TV)
+  void SetFloatVideoWindowState(bool enabled);
+  void NotifyDownloadableFontInfo(const char* scheme_id_uri,
+                                  const char* value,
+                                  const char* data,
+                                  int type);
+  std::vector<std::string> NotifyPlaybackState(int state,
+                                               int player_id,
+                                               const char* url,
+                                               const char* mime_type);
+  void SuspendNetworkLoading();
+  void ResumeNetworkLoading();
+#endif // IS_TIZEN_TV
+  void SetSessionTimeout(uint64_t timeout);
   double GetTextZoomFactor() const;
   void SetTextZoomFactor(double text_zoom_factor);
   double GetPageZoomFactor() const;
   void SetPageZoomFactor(double page_zoom_factor);
   void ExecuteEditCommand(const char* command, const char* value);
+#if BUILDFLAG(IS_TIZEN)
+  void EnterDragState();
+#endif
   void SetOrientation(int orientation);
   int GetOrientation();
   bool TouchEventsEnabled() const;
   void SetTouchEventsEnabled(bool enabled);
   bool MouseEventsEnabled() const;
   void SetMouseEventsEnabled(bool enabled);
+  void SendKeyEvent(Evas_Object* ewk_view, void* key_event, bool is_press);
+  bool SetKeyEventsEnabled(bool enabled);
   void HandleTouchEvents(Ewk_Touch_Event_Type type,
                          const Eina_List* points,
                          const Evas_Modifier* modifiers);
@@ -268,8 +431,10 @@ class EWebView {
                          void* userdata);
   bool SetUserAgent(const char* userAgent);
   bool SetUserAgentAppName(const char* application_name);
+#if BUILDFLAG(IS_TIZEN)
   bool SetPrivateBrowsing(bool incognito);
   bool GetPrivateBrowsing() const;
+#endif
   const char* GetUserAgent() const;
   const char* GetUserAgentAppName() const;
   const char* CacheSelectedText();
@@ -280,13 +445,17 @@ class EWebView {
                       const char* base_uri,
                       const char* unreachable_uri);
   void LoadPlainTextString(const char* plain_text);
+
+  void LoadHTMLStringOverridingCurrentEntry(const char* html,
+                                            const char* base_uri,
+                                            const char* unreachable_url);
   void LoadData(const char* data,
                 size_t size,
                 const char* mime_type,
                 const char* encoding,
                 const char* base_uri,
-                const char* unreachable_uri = NULL);
-
+                const char* unreachable_uri = NULL,
+                bool should_replace_current_entry = false);
   void InvokeLoadError(const GURL& url, int error_code, bool is_cancellation);
 
   void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
@@ -297,27 +466,20 @@ class EWebView {
   void Find(const char* text, Ewk_Find_Options);
   void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
   void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
-  void ShowPopupMenu(const std::vector<blink::MenuItemInfo>& items,
-                     int selectedIndex,
-                     bool multiple);
-  Eina_Bool HidePopupMenu();
-  void UpdateFormNavigation(int formElementCount,
-                            int currentNodeIndex,
-                            bool prevState,
-                            bool nextState);
-  void FormNavigate(bool direction);
-  bool IsSelectPickerShown() const;
-  void CloseSelectPicker();
-  bool FormIsNavigating() const { return formIsNavigating_; }
-  void SetFormIsNavigating(bool formIsNavigating);
-  Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex);
-  Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
-  Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
-  Eina_Bool PopupMenuClose();
+  void HandlePopupMenu(std::vector<blink::mojom::MenuItemPtr> items,
+                       int selectedIndex,
+                       bool multiple,
+                       const gfx::Rect& bounds);
+  void HidePopupMenu();
+  void DidSelectPopupMenuItems(std::vector<int>& indices);
+  void DidCancelPopupMenu();
   void HandleLongPressGesture(const content::ContextMenuParams&);
   void ShowContextMenu(const content::ContextMenuParams&);
   void CancelContextMenu(int request_id);
   void SetScale(double scale_factor);
+  void SetScaleChangedCallback(Ewk_View_Scale_Changed_Callback callback,
+                               void* user_data);
+
   bool GetScrollPosition(int* x, int* y) const;
   void SetScroll(int x, int y);
   void UrlRequestSet(const char* url,
@@ -325,15 +487,14 @@ class EWebView {
                      Eina_Hash* headers,
                      const char* body);
 
+  SelectPickerBase* GetSelectPicker() const { return select_picker_.get(); }
   content::SelectionControllerEfl* GetSelectionController() const;
   content::PopupControllerEfl* GetPopupController() const {
     return popup_controller_.get();
   }
   ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
   void MoveCaret(const gfx::Point& point);
-  void QuerySelectionStyle();
-  void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
-  void SelectLinkText(const gfx::Point& touch_point);
+  void SelectFocusedLink();
   bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
   Eina_Bool ClearSelection();
 
@@ -341,7 +502,11 @@ class EWebView {
   // from render
   void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
 
-  void RenderViewCreated(content::RenderViewHost* render_view_host);
+  void OnFocusIn();
+  void OnFocusOut();
+
+  void UpdateContextMenu(bool is_password_input);
+  void RenderViewReady();
 
   /**
    * Creates a snapshot of given rectangle from EWebView
@@ -401,6 +566,19 @@ class EWebView {
   bool InvokeViewUserMediaPermissionCallback(
       _Ewk_User_Media_Permission_Request* user_media_permission_request_context,
       Eina_Bool* result);
+  void SetViewUserMediaPermissionQueryCallback(
+      Ewk_View_User_Media_Permission_Query_Callback callback,
+      void* user_data);
+  Ewk_User_Media_Permission_Query_Result
+  InvokeViewUserMediaPermissionQueryCallback(
+      _Ewk_User_Media_Permission_Query* user_media_permission_query_context);
+
+  void SetViewLoadErrorPageCallback(Ewk_View_Error_Page_Load_Callback callback,
+                                    void* user_data);
+  const char* InvokeViewLoadErrorPageCallback(const GURL& url,
+                                              int error_code,
+                                              bool is_cancellation);
+  bool IsLoadErrorPageCallbackSet() const;
   void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback,
                                    void* user_data);
   bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
@@ -438,6 +616,9 @@ class EWebView {
 
   bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
   void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
+  bool SavePageAsMHTML(const std::string& path,
+                       Ewk_View_Save_Page_Callback callback,
+                       void* user_data);
   bool IsFullscreen();
   void ExitFullscreen();
   double GetScale();
@@ -455,10 +636,16 @@ class EWebView {
   void JavaScriptPromptReply(const char* result);
   void set_renderer_crashed();
   void GetPageScaleRange(double* min_scale, double* max_scale);
-  void SetDrawsTransparentBackground(bool enabled);
+  bool SetDrawsTransparentBackground(bool enabled);
+  bool GetDrawsTransparentBackground();
+  bool SetBackgroundColor(int red, int green, int blue, int alpha);
+  bool GetBackgroundColor(Ewk_View_Background_Color_Get_Callback callback,
+                          void* user_data);
+  void OnGetBackgroundColor(int callback_id, SkColor bg_color);
+
   void GetSessionData(const char** data, unsigned* length) const;
   bool RestoreFromSessionData(const char* data, unsigned length);
-  void ShowFileChooser(content::RenderFrameHost* render_frame_host,
+  void ShowFileChooser(scoped_refptr<content::FileSelectListener> listener,
                        const blink::mojom::FileChooserParams&);
   void SetBrowserFont();
   bool IsDragging() const;
@@ -480,17 +667,21 @@ class EWebView {
   bool GetLinkMagnifierEnabled() const;
   void SetLinkMagnifierEnabled(bool enabled);
 
-  void SetOverrideEncoding(const std::string& encoding);
+  bool GetHorizontalPanningHold() const;
+  void SetHorizontalPanningHold(bool hold);
+  bool GetVerticalPanningHold() const;
+  void SetVerticalPanningHold(bool hold);
+
   void SetQuotaPermissionRequestCallback(
       Ewk_Quota_Permission_Request_Callback callback,
       void* user_data);
+#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   void InvokeQuotaPermissionRequest(
       _Ewk_Quota_Permission_Request* request,
       content::QuotaPermissionContext::PermissionCallback cb);
   void QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
                          bool allow);
   void QuotaRequestCancel(const _Ewk_Quota_Permission_Request* request);
-#if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
   void SetViewMode(blink::WebViewMode view_mode);
 #endif
   gfx::Point GetContextMenuPosition() const;
@@ -498,6 +689,13 @@ class EWebView {
   content::ContextMenuControllerEfl* GetContextMenuController() {
     return context_menu_.get();
   }
+
+  bool SetMainFrameScrollbarVisible(bool visible);
+  bool GetMainFrameScrollbarVisible(
+      Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback callback,
+      void* user_data);
+  void InvokeMainFrameScrollbarVisibleCallback(int callback_id, bool visible);
+
   void ResetContextMenuController();
   Eina_Bool AddJavaScriptMessageHandler(Evas_Object* view,
                                         Ewk_View_Script_Message_Cb callback,
@@ -516,6 +714,14 @@ class EWebView {
                                                   int64_t current_quota);
   void ExceededIndexedDatabaseQuotaReply(bool allow);
 
+#if defined(TIZEN_VIDEO_HOLE)
+  void EnableVideoHoleSupport();
+#endif
+
+#if defined(TIZEN_TBM_SUPPORT)
+  void SetOffscreenRendering(bool enable);
+#endif
+
   /// ---- Event handling
   bool HandleShow();
   bool HandleHide();
@@ -537,18 +743,108 @@ class EWebView {
                                  Ewk_View_Request_Manifest_Callback callback,
                                  void* user_data);
 
+  void SetBeforeUnloadConfirmPanelCallback(
+      Ewk_View_Before_Unload_Confirm_Panel_Callback callback,
+      void* user_data);
+  void ReplyBeforeUnloadConfirmPanel(Eina_Bool result);
   void SyncAcceptLanguages(const std::string& accept_languages);
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  //Browser edge scroll
+  bool EdgeScrollBy(int delta_x, int delta_y);
+  void GetMousePosition(gfx::Point&);
+  void InvokeEdgeScrollByCallback(const gfx::Point&, bool);
+  // notify web browser video playing status
+  bool IsVideoPlaying(Ewk_Is_Video_Playing_Callback callback, void* user_data);
+  void InvokeIsVideoPlayingCallback(bool is_playing, int callback_id);
+#endif
+
   void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
                       const gfx::Vector2dF& latest_overscroll_delta);
 
   bool SetVisibility(bool enable);
+  void SetDoNotTrack(Eina_Bool);
 
-  content::DateTimeChooserEfl* GetDateTimeChooser() {
-    return date_time_chooser_;
+#if defined(TIZEN_ATK_SUPPORT)
+  void UpdateSpatialNavigationStatus(Eina_Bool enable);
+  void UpdateAccessibilityStatus(Eina_Bool enable);
+
+  bool CheckLazyInitializeAtk() {
+    return is_initialized_ && lazy_initialize_atk_;
   }
+  void InitAtk();
+  bool GetAtkStatus();
+#endif
+#if defined(TIZEN_PEPPER_EXTENSIONS)
+  void InitializePepperExtensionSystem();
+  EwkExtensionSystemDelegate* GetExtensionDelegate();
+  void SetWindowId();
+  void SetPepperExtensionWidgetInfo(Ewk_Value widget_pepper_ext_info);
+  void SetPepperExtensionCallback(Generic_Sync_Call_Callback cb, void* data);
+  void RegisterPepperExtensionDelegate();
+  void UnregisterPepperExtensionDelegate();
+#endif
+
+  bool ShouldIgnoreNavigation(content::NavigationHandle* navigation_handle);
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  void DrawLabel(Evas_Object* image, Eina_Rectangle rect);
+  void DeactivateAtk(bool deactivated);
+  void ClearLabels();
+  void AddDynamicCertificatePath(const std::string& host,
+                                 const std::string& cert_path);
+
+  bool SetMixedContents(bool allow);
+  void ClearAllTilesResources();
+  bool UseEarlyRWI() { return use_early_rwi_; }
+  bool RWIInfoShowed() { return rwi_info_showed_; }
+  GURL RWIURL() { return rwi_gurl_; }
+  void OnDialogClosed();
+  void NotifyMediaStateChanged(uint32_t type,
+                               uint32_t previous,
+                               uint32_t current);
+  void SetHighBitRate(Eina_Bool is_high_bitrate);
+  bool IsHighBitRate() const { return is_high_bitrate_; }
+  void NotifyFirstTimeStamp(unsigned long long timestamp,
+                            int time_base_num,
+                            int time_base_den);
+  void NotifyPESData(const std::string& buf,
+                     unsigned int len,
+                     int media_position);
+  void SetPreferSubtitleLang(const char* lang_list);
+  void NotifySubtitleState(int state, double time_stamp);
+  void NotifySubtitlePlay(int active_track_id,
+                          const char* url,
+                          const char* lang);
+  void NotifySubtitleData(int track_id,
+                          double time_stamp,
+                          const std::string& data,
+                          unsigned int size);
+  void UpdateCurrentTime(double current_time);
+  void UpdateEventData(void* data);
+  double GetCurrentTime() { return current_time_; }
+  void GetMediaDeviceList(Ewk_Media_Device_List_Get_Callback callback,
+                          void* userData);
+  using MediaDeviceEnumeration =
+      std::array<blink::WebMediaDeviceInfoArray, NUM_MEDIA_DEVICE_TYPES>;
+  void OnDeviceListed(const MediaDeviceEnumeration& devices);
+  void SetTranslatedURL(const char* url);
+  void NotifyParentalRatingInfo(const char* info, const char* url);
+  void SetParentalRatingResult(const char* info, bool is_pass);
+#endif  // IS_TIZEN_TV
+
+  void SetDidChangeThemeColorCallback(
+      Ewk_View_Did_Change_Theme_Color_Callback callback,
+      void* user_data);
+  void DidChangeThemeColor(const SkColor& color);
+
+  void OnSelectionRectReceived(const gfx::Rect& selection_rect) const;
 
  private:
+  static void NativeViewResize(void* data,
+                               Evas* e,
+                               Evas_Object* obj,
+                               void* event_info);
   void InitializeContent();
   void InitializeWindowTreeHost();
   void SendDelayedMessages(content::RenderViewHost* render_view_host);
@@ -559,41 +855,62 @@ class EWebView {
       int y,
       Ewk_Hit_Test_Mode mode,
       WebViewAsyncRequestHitTestDataCallback* cb);
-#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
-  static void cameraResultCb(service_h request,
-                             service_h reply,
-                             service_result_e result,
-                             void* data);
-#endif
 
-#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
-  bool LaunchCamera(std::u16string mimetype);
-#endif
-#if !defined(USE_AURA)
-  content::RenderWidgetHostViewEfl* rwhv() const;
+#if BUILDFLAG(IS_TIZEN_TV)
+  void InitInspectorServer();
+
+  void RunPendingSetFocus(Eina_Bool focus);
+  void SetFocusInternal(Eina_Bool focus);
 #endif
+
   JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
 
-  void ReleasePopupMenuList();
+  // Changes viewport without resizing Evas_Object representing webview
+  // and its corresponding RWHV to let Blink renders custom viewport
+  // while showing picker.
+  void AdjustViewPortHeightToPopupMenu(bool is_popup_menu_visible);
 
   void ShowContextMenuInternal(const content::ContextMenuParams&);
 
   void UpdateWebkitPreferencesEfl(content::RenderViewHost*);
 
   void ChangeScroll(int& x, int& y);
+  void ScrollFocusedNodeIntoView();
+
+  void GenerateMHTML(Ewk_View_Save_Page_Callback callback,
+                     void* user_data,
+                     const base::FilePath& file_path);
+  void MHTMLGenerated(Ewk_View_Save_Page_Callback callback,
+                      void* user_data,
+                      const base::FilePath& file_path,
+                      int64_t file_size);
+
+  static void VisibleContentChangedCallback(void* user_data,
+                                            Evas_Object* object,
+                                            void* event_info);
+
+  static void OnCustomScrollBeginCallback(void* user_data,
+                                          Evas_Object* object,
+                                          void* event_info);
+
+  static void OnCustomScrollEndCallback(void* user_data,
+                                        Evas_Object* object,
+                                        void* event_info);
+  void UpdateContextMenuWithParams(const content::ContextMenuParams& params);
+
+  static Eina_Bool DelayedPopulateAndShowContextMenu(void* data);
 
-  scoped_refptr<WebViewEvasEventHandler> evas_event_handler_;
   scoped_refptr<Ewk_Context> context_;
-  scoped_refptr<Ewk_Context> old_context_;
   std::unique_ptr<content::WebContents> web_contents_;
   std::unique_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
+  std::unique_ptr<content::WebViewDelegate> webview_delegate_;
   std::string pending_url_request_;
   std::unique_ptr<Ewk_Settings> settings_;
   std::unique_ptr<_Ewk_Frame> frame_;
   std::unique_ptr<_Ewk_Policy_Decision> window_policy_;
-  Evas_Object* evas_object_;
-  Evas_Object* native_view_;
-  bool touch_events_enabled_;
+  Evas_Object* ewk_view_;
+  Evas_Object* efl_main_layout_;
+  bool key_events_enabled_ = true;
   bool mouse_events_enabled_;
   double text_zoom_factor_;
   mutable std::string user_agent_;
@@ -601,18 +918,10 @@ class EWebView {
   std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_;
   std::string selected_text_cached_;
 
-  Eina_List* popupMenuItems_;
-  Popup_Picker* popupPicker_;
-  bool formIsNavigating_;
-  typedef struct {
-    int count;
-    int position;
-    bool prevState;
-    bool nextState;
-  } formNavigation;
-  formNavigation formNavigation_;
   std::unique_ptr<content::ContextMenuControllerEfl> context_menu_;
-#if !defined(EWK_BRINGUP)  // FIXME: m71 bringup
+#if BUILDFLAG(IS_TIZEN_TV)
+  std::unique_ptr<_Ewk_File_Chooser_Request> file_chooser_request_;
+#else
   std::unique_ptr<content::FileChooserControllerEfl> file_chooser_;
 #endif
   std::unique_ptr<content::PopupControllerEfl> popup_controller_;
@@ -628,6 +937,22 @@ class EWebView {
       MHTMLCallbackDetails;
   base::IDMap<MHTMLCallbackDetails*> mhtml_callback_map_;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  base::IDMap<IsVideoPlayingCallback*> is_video_playing_callback_map_;
+#endif
+
+  typedef WebViewCallback<Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback,
+                          bool>
+      MainFrameScrollbarVisibleGetCallback;
+  base::IDMap<MainFrameScrollbarVisibleGetCallback*>
+      main_frame_scrollbar_visible_callback_map_;
+
+  base::IDMap<BackgroundColorGetCallback*> background_color_get_callback_map_;
+
+#if BUILDFLAG(IS_TIZEN_TV)
+  GetMediaDeviceCallback device_cb_;
+#endif
+
   gfx::Size contents_size_;
   double progress_;
   mutable std::string title_;
@@ -643,6 +968,14 @@ class EWebView {
   WebViewCallback<Ewk_View_User_Media_Permission_Callback,
                   _Ewk_User_Media_Permission_Request*>
       user_media_permission_cb_;
+  WebViewCallbackWithReturnValue<Ewk_User_Media_Permission_Query_Result,
+                                 Ewk_View_User_Media_Permission_Query_Callback,
+                                 _Ewk_User_Media_Permission_Query*>
+      user_media_permission_query_cb_;
+  WebViewErrorPageLoadCallback<Ewk_View_Error_Page_Load_Callback,
+                               Ewk_Error*,
+                               Ewk_Error_Page*>
+      load_error_page_cb_;
   WebViewCallback<Ewk_View_Unfocus_Allow_Callback, Ewk_Unfocus_Direction>
       unfocus_allow_cb_;
   WebViewCallback<Ewk_View_Notification_Permission_Callback,
@@ -653,8 +986,12 @@ class EWebView {
       quota_request_callback_;
   WebViewCallback<Ewk_View_Authentication_Callback, _Ewk_Auth_Challenge*>
       authentication_cb_;
+  WebViewCallback<Ewk_View_Scale_Changed_Callback, double> scale_changed_cb_;
 
   std::unique_ptr<content::InputPicker> input_picker_;
+
+  DidChangeThemeColorCallback did_change_theme_color_callback_;
+
   base::IDMap<WebApplicationIconUrlGetCallback*>
       web_app_icon_url_get_callback_map_;
   base::IDMap<WebApplicationIconUrlsGetCallback*>
@@ -674,26 +1011,54 @@ class EWebView {
       long long>
       exceeded_indexed_db_quota_callback_;
   std::unique_ptr<Ewk_Security_Origin> exceeded_indexed_db_quota_origin_;
-
-#if BUILDFLAG(IS_TIZEN)
-  blink::mojom::FileChooserParams::Mode filechooser_mode_;
-#endif
+#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   std::map<const _Ewk_Quota_Permission_Request*,
            content::QuotaPermissionContext::PermissionCallback>
       quota_permission_request_map_;
+#endif
+#if BUILDFLAG(IS_TIZEN)
+  blink::mojom::FileChooserParams::Mode filechooser_mode_ =
+      blink::mojom::FileChooserParams::Mode::kOpen;
+  Ecore_Event_Handler* window_rotate_handler_ = nullptr;
+#endif
 
   bool is_initialized_;
 
+#if BUILDFLAG(IS_TIZEN_TV)
+  bool is_processing_edge_scroll_;
+  bool use_early_rwi_;
+  bool rwi_info_showed_;
+  GURL rwi_gurl_;
+  bool is_high_bitrate_ = false;
+
+  base::OnceClosure pending_setfocus_closure_;
+
+  enum PlaybackState {
+    kPlaybackLoad = 0,
+    // kPlaybackReady: player with both audio and video starts prepare and will
+    // acquire audio and video resources (if they are not already taken)
+    kPlaybackReady,
+    kPlaybackStart,
+    kPlaybackFinish,
+    kPlaybackStop,
+  };
+  double current_time_ = 0.0;
+#endif
+
   std::unique_ptr<_Ewk_Back_Forward_List> back_forward_list_;
 
-  static content::WebContentsEflDelegate::WebContentsCreateCallback
+  static content::WebViewDelegate::WebContentsCreateCallback
       create_new_window_web_contents_cb_;
 
- private:
+#if defined(TIZEN_VIDEO_HOLE)
+  void EnableVideoHoleSupportInternal();
+#endif
   gfx::Vector2d previous_scroll_position_;
 
   gfx::Point context_menu_position_;
 
+  content::ContextMenuParams saved_context_menu_params_;
+
   std::vector<IPC::Message*> delayed_messages_;
 
   std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
@@ -701,10 +1066,25 @@ class EWebView {
   content::AcceptLanguagesHelper::AcceptLangsChangedCallback
       accept_langs_changed_callback_;
 
+  std::unique_ptr<SelectPickerBase> select_picker_;
   std::unique_ptr<aura::WindowTreeHost> host_;
   std::unique_ptr<aura::client::FocusClient> focus_client_;
   std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
-  content::DateTimeChooserEfl* date_time_chooser_ = nullptr;
+  std::unique_ptr<ui::CompositorObserver> compositor_observer_;
+
+#if defined(TIZEN_ATK_SUPPORT)
+  std::unique_ptr<EWebAccessibility> eweb_accessibility_;
+  bool lazy_initialize_atk_ = false;
+#endif
+#if defined(TIZEN_PEPPER_EXTENSIONS)
+  content::ExtensionSystemDelegateManager::RenderFrameID render_frame_id_;
+#endif
+#if defined(TIZEN_VIDEO_HOLE)
+  bool pending_video_hole_setting_ = false;
+#endif
+
+  Ecore_Timer* delayed_show_context_menu_timer_ = nullptr;
+  base::WeakPtrFactory<EWebView> weak_factory_{this};
 };
 
 const unsigned int g_default_tilt_motion_sensitivity = 3;