Change WebView API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / web-view / web-view-impl.cpp
index 7da5f9d..5836f42 100644 (file)
@@ -61,7 +61,11 @@ DALI_TYPE_REGISTRATION_END()
 WebView::WebView( const std::string& locale, const std::string& timezoneId )
 : Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
   mUrl(),
-  mWebViewSize( Stage::GetCurrent().GetSize() )
+  mVisual(),
+  mWebViewSize( Stage::GetCurrent().GetSize() ),
+  mWebEngine(),
+  mPageLoadStartedSignal(),
+  mPageLoadFinishedSignal()
 {
   mWebEngine = Dali::WebEngine::New();
   if ( mWebEngine )
@@ -196,19 +200,11 @@ void WebView::EvaluateJavaScript( const std::string& script )
   }
 }
 
-void WebView::AddJavaScriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName, std::function< std::string(const std::string&) > callback )
+void WebView::AddJavaScriptMessageHandler( const std::string& exposedObjectName, std::function< void( const std::string& ) > handler )
 {
   if ( mWebEngine )
   {
-    mWebEngine.AddJavaScriptInterface( exposedObjectName, jsFunctionName, callback );
-  }
-}
-
-void WebView::RemoveJavascriptInterface( const std::string& exposedObjectName, const std::string& jsFunctionName )
-{
-  if ( mWebEngine )
-  {
-    mWebEngine.RemoveJavascriptInterface( exposedObjectName, jsFunctionName );
+    mWebEngine.AddJavaScriptMessageHandler( exposedObjectName, handler );
   }
 }