Add callbacks for form repost decision and frame rendering. 77/254177/9
authorhuayong.xu <huayong.xu@samsung.com>
Wed, 24 Feb 2021 09:43:46 +0000 (17:43 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Mon, 29 Mar 2021 02:49:31 +0000 (10:49 +0800)
This patch is to add callbacks for form repost decision and frame
rendering in web view.

Change-Id: I801b5dddcceae2e68f43c5883f576ef988adb112

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp
automated-tests/src/dali-toolkit/utc-Dali-WebView.cpp
dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h [changed mode: 0644->0755]
dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.cpp [new file with mode: 0644]
dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h [new file with mode: 0755]
dali-toolkit/devel-api/controls/web-view/web-view.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/devel-api/file.list
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h

index b371dab..5b0f13d 100755 (executable)
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/public-api/adaptor-framework/native-image-source.h>
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/object/base-object.h>
+#include <memory>
 #include <toolkit-application.h>
 
 namespace Dali
@@ -215,6 +217,16 @@ private:
   WebEngineBackForwardListItem* pMockItem;
 };
 
+class MockWebEngineFormRepostDecision : public WebEngineFormRepostDecision
+{
+public:
+  MockWebEngineFormRepostDecision()
+  {
+  }
+
+  void Reply(bool allowed) override {}
+};
+
 class MockWebEngineSettings : public WebEngineSettings
 {
 public:
@@ -689,6 +701,16 @@ public:
     return mUrlChangedSignal;
   }
 
+  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& FormRepostDecisionSignal()
+  {
+    return mFormRepostDecisionSignal;
+  }
+
+  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& FrameRenderedSignal()
+  {
+    return mFrameRenderedSignal;
+  }
+
   std::string                                                mUrl;
   std::vector< std::string >                                 mHistory;
   size_t                                                     mCurrentPlusOnePos;
@@ -700,15 +722,17 @@ public:
   std::vector<JavaScriptEvaluatedResultCallback>             mResultCallbacks;
   bool                                                       mEvaluating;
 
-  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType mScrollEdgeReachedSignal;
-  Dali::Vector2                                               mScrollPosition;
-  Dali::Vector2                                               mScrollSize;
-  Dali::Vector2                                               mContentSize;
-  WebEngineBackForwardList*                                   mockWebEngineBackForwardList;
-  WebEngineContext*                                           mockWebEngineContext;
-  WebEngineCookieManager*                                     mockWebEngineCookieManager;
-  WebEngineSettings*                                          mockWebEngineSettings;
-  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType        mUrlChangedSignal;
+  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType  mScrollEdgeReachedSignal;
+  Dali::Vector2                                                mScrollPosition;
+  Dali::Vector2                                                mScrollSize;
+  Dali::Vector2                                                mContentSize;
+  WebEngineBackForwardList*                                    mockWebEngineBackForwardList;
+  WebEngineContext*                                            mockWebEngineContext;
+  WebEngineCookieManager*                                      mockWebEngineCookieManager;
+  WebEngineSettings*                                           mockWebEngineSettings;
+  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType         mUrlChangedSignal;
+  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType mFormRepostDecisionSignal;
+  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType      mFrameRenderedSignal;
 
   JavaScriptAlertCallback                                     mJavaScriptAlertCallback;
   JavaScriptConfirmCallback                                   mJavaScriptConfirmCallback;
@@ -757,6 +781,10 @@ bool OnLoadUrl()
     gInstance->mPageLoadInProgressSignal.Emit( gInstance->mUrl );
     gInstance->mPageLoadFinishedSignal.Emit( gInstance->mUrl );
     gInstance->mUrlChangedSignal.Emit( "http://new-test" );
+
+    std::shared_ptr<Dali::WebEngineFormRepostDecision> decision(new MockWebEngineFormRepostDecision());
+    gInstance->mFormRepostDecisionSignal.Emit(decision);
+    gInstance->mFrameRenderedSignal.Emit();
   }
   return false;
 }
@@ -1163,5 +1191,15 @@ Dali::WebEnginePlugin::WebEngineUrlChangedSignalType& WebEngine::UrlChangedSigna
   return Internal::Adaptor::GetImplementation( *this ).UrlChangedSignal();
 }
 
+Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType& WebEngine::FormRepostDecisionSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).FormRepostDecisionSignal();
+}
+
+Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType& WebEngine::FrameRenderedSignal()
+{
+  return Internal::Adaptor::GetImplementation( *this ).FrameRenderedSignal();
+}
+
 } // namespace Dali;
 
index 36a058d..4d42e96 100755 (executable)
@@ -33,6 +33,7 @@
 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
+#include <dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-view.h>
 
@@ -57,6 +58,9 @@ static int gJavaScriptPromptCallbackCalled = 0;
 static bool gTouched = false;
 static bool gHovered = false;
 static bool gWheelEventHandled = false;
+static int gFormRepostDecisionCallbackCalled = 0;
+static std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> gFormRepostDecisionInstance;
+static int gFrameRenderedCallbackCalled = 0;
 
 struct CallbackFunctor
 {
@@ -142,6 +146,17 @@ static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheel )
   return true;
 }
 
+static void OnFormRepostDecision(WebView, std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> decision)
+{
+  gFormRepostDecisionCallbackCalled++;
+  gFormRepostDecisionInstance = decision;
+}
+
+static void OnFrameRendered(WebView)
+{
+  gFrameRenderedCallbackCalled++;
+}
+
 } // namespace
 
 void web_view_startup(void)
@@ -504,6 +519,46 @@ int UtcDaliWebViewHoverAndWheel(void)
   END_TEST;
 }
 
+int UtcDaliWebViewFormRepostDecisionFrameRendering(void)
+{
+  ToolkitTestApplication application;
+
+  WebView view = WebView::New();
+  view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
+  view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+  application.GetScene().Add( view );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( view );
+
+  ConnectionTracker* testTracker = new ConnectionTracker();
+  view.FormRepostDecisionSignal().Connect(&OnFormRepostDecision);
+  view.FrameRenderedSignal().Connect(&OnFrameRendered);
+  bool signal1 = false;
+  bool signal2 = false;
+  view.ConnectSignal( testTracker, "formRepostDecision", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "frameRendered", CallbackFunctor(&signal2) );
+  DALI_TEST_EQUALS( gFormRepostDecisionCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gFrameRenderedCallbackCalled, 0, TEST_LOCATION );
+
+  view.LoadUrl( TEST_URL1 );
+  Test::EmitGlobalTimerSignal();
+  DALI_TEST_EQUALS( gFormRepostDecisionCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gFrameRenderedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_CHECK( signal1 & signal2);
+
+  // form repost decision.
+  DALI_TEST_CHECK(gFormRepostDecisionInstance);
+  gFormRepostDecisionInstance->Reply(true);
+
+  // reset
+  gFormRepostDecisionInstance = nullptr;
+
+  END_TEST;
+}
+
 int UtcDaliWebViewGetWebBackForwardList(void)
 {
   ToolkitTestApplication application;
old mode 100644 (file)
new mode 100755 (executable)
index a332e06..adb133a
@@ -37,7 +37,7 @@ namespace Toolkit
  */
 
 /**
- * @brief WebCookieManager is a control for settings of WebView.
+ * @brief WebCookieManager is a control for cookie manager of WebView.
  *
  *
  * For working WebCookieManager, a WebView should be provided.
diff --git a/dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.cpp b/dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.cpp
new file mode 100644 (file)
index 0000000..219d2ca
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h>
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+WebFormRepostDecision::WebFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision)
+: mFormRepostDecision(std::move(decision))
+{
+}
+
+WebFormRepostDecision::~WebFormRepostDecision()
+{
+}
+
+void WebFormRepostDecision::Reply(bool allowed)
+{
+  if(mFormRepostDecision)
+  {
+    mFormRepostDecision->Reply(allowed);
+  }
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h b/dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h
new file mode 100755 (executable)
index 0000000..755fe57
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef DALI_TOOLKIT_WEB_FORM_REPOST_DECISION_H
+#define DALI_TOOLKIT_WEB_FORM_REPOST_DECISION_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <memory>
+#include <string>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+
+namespace Dali
+{
+class WebEngineFormRepostDecision;
+
+namespace Toolkit
+{
+/**
+ * @addtogroup dali_toolkit_controls_web_view
+ * @{
+ */
+
+/**
+ * @brief WebFormRepostDecision is a class for form repost decision of WebView.
+ *
+ *
+ * For working WebFormRepostDecision, a Dali::WebEngineFormRepostDecision should be provided.
+ *
+ */
+class DALI_TOOLKIT_API WebFormRepostDecision
+{
+public:
+  /**
+   * @brief Creates a WebFormRepostDecision.
+   */
+  WebFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision);
+
+  /**
+   * @brief Destructor.
+   */
+  virtual ~WebFormRepostDecision() final;
+
+  /**
+   * @brief Reply the result about form repost decision.
+   *
+   * @param[in] allowed Whether allow form repost decision request or not
+   */
+  void Reply(bool allowed);
+
+private:
+  std::shared_ptr<Dali::WebEngineFormRepostDecision> mFormRepostDecision;
+};
+
+/**
+ * @}
+ */
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_WEB_FORM_REPOST_DECISION_H
index 201f280..c10358a 100644 (file)
@@ -164,34 +164,34 @@ void WebView::AddJavaScriptMessageHandler(const std::string& exposedObjectName,
   Dali::Toolkit::GetImpl(*this).AddJavaScriptMessageHandler(exposedObjectName, handler);
 }
 
-void WebView::RegisterJavaScriptAlertCallback( Dali::WebEnginePlugin::JavaScriptAlertCallback callback )
+void WebView::RegisterJavaScriptAlertCallback(Dali::WebEnginePlugin::JavaScriptAlertCallback callback)
 {
-  Dali::Toolkit::GetImpl( *this ).RegisterJavaScriptAlertCallback( callback );
+  Dali::Toolkit::GetImpl(*this).RegisterJavaScriptAlertCallback(callback);
 }
 
 void WebView::JavaScriptAlertReply()
 {
-  Dali::Toolkit::GetImpl( *this ).JavaScriptAlertReply();
+  Dali::Toolkit::GetImpl(*this).JavaScriptAlertReply();
 }
 
-void WebView::RegisterJavaScriptConfirmCallback( Dali::WebEnginePlugin::JavaScriptConfirmCallback callback )
+void WebView::RegisterJavaScriptConfirmCallback(Dali::WebEnginePlugin::JavaScriptConfirmCallback callback)
 {
-  Dali::Toolkit::GetImpl( *this ).RegisterJavaScriptConfirmCallback( callback );
+  Dali::Toolkit::GetImpl(*this).RegisterJavaScriptConfirmCallback(callback);
 }
 
-void WebView::JavaScriptConfirmReply( bool confirmed )
+void WebView::JavaScriptConfirmReply(bool confirmed)
 {
-  Dali::Toolkit::GetImpl( *this ).JavaScriptConfirmReply( confirmed );
+  Dali::Toolkit::GetImpl(*this).JavaScriptConfirmReply(confirmed);
 }
 
-void WebView::RegisterJavaScriptPromptCallback( Dali::WebEnginePlugin::JavaScriptPromptCallback callback )
+void WebView::RegisterJavaScriptPromptCallback(Dali::WebEnginePlugin::JavaScriptPromptCallback callback)
 {
-  Dali::Toolkit::GetImpl( *this ).RegisterJavaScriptPromptCallback( callback );
+  Dali::Toolkit::GetImpl(*this).RegisterJavaScriptPromptCallback(callback);
 }
 
-void WebView::JavaScriptPromptReply( const std::string& result )
+void WebView::JavaScriptPromptReply(const std::string& result)
 {
-  Dali::Toolkit::GetImpl( *this ).JavaScriptPromptReply( result );
+  Dali::Toolkit::GetImpl(*this).JavaScriptPromptReply(result);
 }
 
 void WebView::ClearHistory()
@@ -201,7 +201,7 @@ void WebView::ClearHistory()
 
 void WebView::ClearAllTilesResources()
 {
-  Dali::Toolkit::GetImpl( *this ).ClearAllTilesResources();
+  Dali::Toolkit::GetImpl(*this).ClearAllTilesResources();
 }
 
 WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
@@ -211,7 +211,7 @@ WebView::WebViewPageLoadSignalType& WebView::PageLoadStartedSignal()
 
 WebView::WebViewPageLoadSignalType& WebView::PageLoadInProgressSignal()
 {
-  return Dali::Toolkit::GetImpl( *this ).PageLoadInProgressSignal();
+  return Dali::Toolkit::GetImpl(*this).PageLoadInProgressSignal();
 }
 
 WebView::WebViewPageLoadSignalType& WebView::PageLoadFinishedSignal()
@@ -231,7 +231,17 @@ WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
 
 WebView::WebViewUrlChangedSignalType& WebView::UrlChangedSignal()
 {
-  return Dali::Toolkit::GetImpl( *this ).UrlChangedSignal();
+  return Dali::Toolkit::GetImpl(*this).UrlChangedSignal();
+}
+
+WebView::WebViewFormRepostDecisionSignalType& WebView::FormRepostDecisionSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).FormRepostDecisionSignal();
+}
+
+WebView::WebViewFrameRenderedSignalType& WebView::FrameRenderedSignal()
+{
+  return Dali::Toolkit::GetImpl(*this).FrameRenderedSignal();
 }
 
 WebView::WebView(Internal::WebView& implementation)
index 2bb556e..75c911d 100755 (executable)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <functional>
+#include <memory>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
@@ -33,6 +34,7 @@ class ImageView;
 class WebBackForwardList;
 class WebContext;
 class WebCookieManager;
+class WebFormRepostDecision;
 class WebSettings;
 
 namespace Internal DALI_INTERNAL
@@ -207,6 +209,16 @@ public:
    */
   using WebViewUrlChangedSignalType = Signal<void(WebView, const std::string&)>;
 
+  /**
+   * @brief WebView signal type related with form repost decision.
+   */
+  using WebViewFormRepostDecisionSignalType = Signal<void(WebView, std::shared_ptr<Dali::Toolkit::WebFormRepostDecision>)>;
+
+  /**
+   * @brief WebView signal type related with frame rendered.
+   */
+  using WebViewFrameRenderedSignalType = Signal<void(WebView)>;
+
 public:
   /**
    * @brief Creates an initialized WebView.
@@ -493,6 +505,20 @@ public:
    */
   WebViewUrlChangedSignalType& UrlChangedSignal();
 
+  /**
+   * @brief Connects to this signal to be notified when form repost decision is requested.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewFormRepostDecisionSignalType& FormRepostDecisionSignal();
+
+  /**
+   * @brief Connects to this signal to be notified when frame is rendered.
+   *
+   * @return A signal object to connect with.
+   */
+  WebViewFrameRenderedSignalType& FrameRenderedSignal();
+
 public: // Not intended for application developers
   /// @cond internal
   /**
index 0e1ec7d..766c8ac 100755 (executable)
@@ -41,6 +41,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/controls/web-view/web-back-forward-list-item.cpp
   ${devel_api_src_dir}/controls/web-view/web-context.cpp
   ${devel_api_src_dir}/controls/web-view/web-cookie-manager.cpp
+  ${devel_api_src_dir}/controls/web-view/web-form-repost-decision.cpp
   ${devel_api_src_dir}/controls/web-view/web-settings.cpp
   ${devel_api_src_dir}/controls/web-view/web-view.cpp
   ${devel_api_src_dir}/focus-manager/keyinput-focus-manager.cpp
@@ -256,6 +257,7 @@ SET( devel_api_web_view_header_files
   ${devel_api_src_dir}/controls/web-view/web-back-forward-list-item.h
   ${devel_api_src_dir}/controls/web-view/web-context.h
   ${devel_api_src_dir}/controls/web-view/web-cookie-manager.h
+  ${devel_api_src_dir}/controls/web-view/web-form-repost-decision.h
   ${devel_api_src_dir}/controls/web-view/web-settings.h
   ${devel_api_src_dir}/controls/web-view/web-view.h
 )
index c4bf4e9..3425c29 100755 (executable)
@@ -22,6 +22,7 @@
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list.h>
 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
+#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
 #include <dali/devel-api/adaptor-framework/web-engine-settings.h>
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
 #include <cstring>
+#include <memory>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
+#include <dali-toolkit/devel-api/controls/web-view/web-form-repost-decision.h>
 #include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
 #include <dali-toolkit/devel-api/image-loader/texture-manager.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
@@ -79,6 +82,8 @@ DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadFinished",   PAGE_LOAD_FINIS
 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadError",      PAGE_LOAD_ERROR_SIGNAL      )
 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "scrollEdgeReached",  SCROLL_EDGE_REACHED_SIGNAL  )
 DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "urlChanged",         URL_CHANGED_SIGNAL          )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "formRepostDecision", FORM_REPOST_DECISION_SIGNAL )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "frameRendered",      FRAME_RENDERED_SIGNAL       )
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
@@ -205,6 +210,8 @@ void WebView::OnInitialize()
     mWebEngine.PageLoadErrorSignal().Connect(this, &WebView::OnPageLoadError);
     mWebEngine.ScrollEdgeReachedSignal().Connect(this, &WebView::OnScrollEdgeReached);
     mWebEngine.UrlChangedSignal().Connect(this, &WebView::OnUrlChanged);
+    mWebEngine.FormRepostDecisionSignal().Connect(this, &WebView::OnFormRepostDecision);
+    mWebEngine.FrameRenderedSignal().Connect(this, &WebView::OnFrameRendered);
 
     mWebContext         = std::unique_ptr<Dali::Toolkit::WebContext>(new WebContext(mWebEngine.GetContext()));
     mWebCookieManager   = std::unique_ptr<Dali::Toolkit::WebCookieManager>(new WebCookieManager(mWebEngine.GetCookieManager()));
@@ -523,6 +530,16 @@ Dali::Toolkit::WebView::WebViewUrlChangedSignalType& WebView::UrlChangedSignal()
   return mUrlChangedSignal;
 }
 
+Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType& WebView::FormRepostDecisionSignal()
+{
+  return mFormRepostDecisionSignal;
+}
+
+Dali::Toolkit::WebView::WebViewFrameRenderedSignalType& WebView::FrameRenderedSignal()
+{
+  return mFrameRenderedSignal;
+}
+
 void WebView::OnPageLoadStarted(const std::string& url)
 {
   if(!mPageLoadStartedSignal.Empty())
@@ -577,6 +594,25 @@ void WebView::OnUrlChanged(const std::string& url)
   }
 }
 
+void WebView::OnFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision)
+{
+  if(!mFormRepostDecisionSignal.Empty())
+  {
+    Dali::Toolkit::WebView                                handle(GetOwner());
+    std::shared_ptr<Dali::Toolkit::WebFormRepostDecision> repostDecision(new Dali::Toolkit::WebFormRepostDecision(decision));
+    mFormRepostDecisionSignal.Emit(handle, std::move(repostDecision));
+  }
+}
+
+void WebView::OnFrameRendered()
+{
+  if(!mFrameRenderedSignal.Empty())
+  {
+    Dali::Toolkit::WebView handle(GetOwner());
+    mFrameRenderedSignal.Emit(handle);
+  }
+}
+
 bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
 {
   Dali::BaseHandle handle(object);
@@ -614,6 +650,16 @@ bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tr
     webView.UrlChangedSignal().Connect(tracker, functor);
     connected = true;
   }
+  else if(0 == strcmp(signalName.c_str(), FORM_REPOST_DECISION_SIGNAL))
+  {
+    webView.FormRepostDecisionSignal().Connect(tracker, functor);
+    connected = true;
+  }
+  else if(0 == strcmp(signalName.c_str(), FRAME_RENDERED_SIGNAL))
+  {
+    webView.FrameRenderedSignal().Connect(tracker, functor);
+    connected = true;
+  }
 
   return connected;
 }
index 0a610b5..24eda62 100755 (executable)
@@ -199,7 +199,7 @@ public:
   void ClearHistory();
 
   /**
-   * @brief Clears all tiles resources of Web.
+   * @copydoc Dali::Toolkit::WebView::ClearAllTilesResources()
    */
   void ClearAllTilesResources();
 
@@ -233,6 +233,16 @@ public:
    */
   Dali::Toolkit::WebView::WebViewUrlChangedSignalType& UrlChangedSignal();
 
+  /**
+   * @copydoc Dali::Toolkit::WebView::FormRepostDecisionSignal()
+   */
+  Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType& FormRepostDecisionSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::WebView::FrameRenderedSignal()
+   */
+  Dali::Toolkit::WebView::WebViewFrameRenderedSignalType& FrameRenderedSignal();
+
 public: // Properties
   /**
    * @brief Called when a property of an object of this type is set.
@@ -472,6 +482,17 @@ private:
    */
   bool OnWheelEvent(Actor actor, const Dali::WheelEvent& wheel);
 
+  /**
+   * @brief Callback function to be called when form repost decision need be checked.
+   * @param[in] decision The new decision for form repost
+   */
+  void OnFormRepostDecision(std::shared_ptr<Dali::WebEngineFormRepostDecision> decision);
+
+  /**
+   * @brief Callback function to be called when frame is rendered.
+   */
+  void OnFrameRendered();
+
 private:
   std::string                 mUrl;
   Dali::Toolkit::Visual::Base mVisual;
@@ -498,6 +519,9 @@ private:
   Dali::Rect<int>                                     mWebViewArea;
   bool                                                mMouseEventsEnabled;
   bool                                                mKeyEventsEnabled;
+
+  Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType mFormRepostDecisionSignal;
+  Dali::Toolkit::WebView::WebViewFrameRenderedSignalType      mFrameRenderedSignal;
 };
 
 } // namespace Internal