[M108 Migration] Migrate patches related to NavigationThrottle and Ewk_Error
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / eweb_view.h
index b4abe90..00a71e1 100644 (file)
 #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 "ui/aura/window_tree_host.h"
 #include "ui/gfx/geometry/point.h"
 #include "ui/gfx/geometry/size.h"
 #include "web_contents_delegate_efl.h"
 
+namespace aura {
+namespace client {
+class FocusClient;
+class WindowParentingClient;
+}  // namespace client
+}  // namespace aura
+
 namespace content {
 class RenderFrameHost;
 class RenderViewHost;
-class RenderWidgetHostViewEfl;
+class RenderWidgetHostViewAura;
 class WebContentsDelegateEfl;
 class ContextMenuControllerEfl;
-class WebContentsViewEfl;
 class PopupControllerEfl;
 }
 
@@ -173,10 +180,11 @@ class EWebView {
   // call this once after created and before use
   void Initialize();
 
-  void CreateNewWindow(
+  bool CreateNewWindow(
       content::WebContentsEflDelegate::WebContentsCreateCallback);
   static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
 
+  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_; }
@@ -234,7 +242,7 @@ class EWebView {
   bool GetPrivateBrowsing() const;
   const char* GetUserAgent() const;
   const char* GetUserAgentAppName() const;
-  const char* GetSelectedText() const;
+  const char* CacheSelectedText();
   Ewk_Settings* GetSettings() { return settings_.get(); }
   _Ewk_Frame* GetMainFrame();
   void UpdateWebKitPreferences();
@@ -249,10 +257,7 @@ class EWebView {
                 const char* base_uri,
                 const char* unreachable_uri = NULL);
 
-  void InvokeLoadError(const GURL& url,
-                       int error_code,
-                       const std::string& error_description,
-                       bool is_main_frame);
+  void InvokeLoadError(const GURL& url, int error_code, bool is_cancellation);
 
   void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
                            void* user_data);
@@ -282,7 +287,7 @@ class EWebView {
   void HandleLongPressGesture(const content::ContextMenuParams&);
   void ShowContextMenu(const content::ContextMenuParams&);
   void CancelContextMenu(int request_id);
-  void SetScale(double scale_factor, int x, int y);
+  void SetScale(double scale_factor);
   bool GetScrollPosition(int* x, int* y) const;
   void SetScroll(int x, int y);
   void UrlRequestSet(const char* url,
@@ -406,6 +411,7 @@ class EWebView {
   void ExitFullscreen();
   double GetScale();
   void DidChangePageScaleFactor(double scale_factor);
+  void SetScaledContentsSize();
   void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
                                   void* user_data);
   void JavaScriptAlertReply();
@@ -478,10 +484,20 @@ class EWebView {
   void HandleZoomGesture(blink::WebGestureEvent& event);
   void ClosePage();
 
+  void RequestManifest(Ewk_View_Request_Manifest_Callback callback,
+                       void* user_data);
+  void DidRespondRequestManifest(_Ewk_View_Request_Manifest* manifest,
+                                 Ewk_View_Request_Manifest_Callback callback,
+                                 void* user_data);
+
   void SyncAcceptLanguages(const std::string& accept_languages);
 
+  void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
+                      const gfx::Vector2dF& latest_overscroll_delta);
+
  private:
   void InitializeContent();
+  void InitializeWindowTreeHost();
   void SendDelayedMessages(content::RenderViewHost* render_view_host);
 
   void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
@@ -490,20 +506,22 @@ class EWebView {
       int y,
       Ewk_Hit_Test_Mode mode,
       WebViewAsyncRequestHitTestDataCallback* cb);
-
+#if !defined(USE_AURA)
   content::WebContentsViewEfl* GetWebContentsViewEfl() const;
-
-#if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
+#endif
+#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
   static void cameraResultCb(service_h request,
                              service_h reply,
                              service_result_e result,
                              void* data);
 #endif
 
-#if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
+#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
   bool LaunchCamera(std::u16string mimetype);
 #endif
+#if !defined(USE_AURA)
   content::RenderWidgetHostViewEfl* rwhv() const;
+#endif
   JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
 
   void ReleasePopupMenuList();
@@ -531,6 +549,7 @@ class EWebView {
   mutable std::string user_agent_;
   mutable std::string user_agent_app_name_;
   std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_;
+  std::string selected_text_cached_;
 
   Eina_List* popupMenuItems_;
   Popup_Picker* popupPicker_;
@@ -596,7 +615,7 @@ class EWebView {
   std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
   std::unique_ptr<ScrollDetector> scroll_detector_;
 
-#if defined(OS_TIZEN)
+#if BUILDFLAG(IS_TIZEN)
   blink::mojom::FileChooserParams::Mode filechooser_mode_;
 #endif
   std::map<const _Ewk_Quota_Permission_Request*,
@@ -621,6 +640,10 @@ class EWebView {
 
   content::ContentBrowserClientEfl::AcceptLangsChangedCallback
       accept_langs_changed_callback_;
+
+  std::unique_ptr<aura::WindowTreeHost> host_;
+  std::unique_ptr<aura::client::FocusClient> focus_client_;
+  std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
 };
 
 const unsigned int g_default_tilt_motion_sensitivity = 3;