Merge "Update position & size of web view." into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / web-view / web-view-impl.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 1c9d939..9e31e46
 
 // EXTERNAL INCLUDES
 #include <cstring>
+#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-settings.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/devel-api/common/stage.h>
 
 // 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-settings.h>
 #include <dali-toolkit/devel-api/image-loader/texture-manager.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/public-api/image-loader/image.h>
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 
 namespace Dali
@@ -50,32 +59,20 @@ BaseHandle Create()
   return Toolkit::WebView::New();
 }
 
-DALI_ENUM_TO_STRING_TABLE_BEGIN( CacheModel )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::WebView::CacheModel, DOCUMENT_VIEWER )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::WebView::CacheModel, DOCUMENT_BROWSER )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::WebView::CacheModel, PRIMARY_WEB_BROWSER )
-DALI_ENUM_TO_STRING_TABLE_END( CacheModel )
-
-DALI_ENUM_TO_STRING_TABLE_BEGIN( CookieAcceptPolicy )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::WebView::CookieAcceptPolicy, ALWAYS )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::WebView::CookieAcceptPolicy, NEVER )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::WebView::CookieAcceptPolicy, NO_THIRD_PARTY )
-DALI_ENUM_TO_STRING_TABLE_END( CookieAcceptPolicy )
-
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::WebView, Toolkit::Control, Create )
 
 DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "url",                     STRING,  URL                        )
-DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "cacheModel",              STRING,  CACHE_MODEL                )
-DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "cookieAcceptPolicy",      STRING,  COOKIE_ACCEPT_POLICY       )
 DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "userAgent",               STRING,  USER_AGENT                 )
-DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "enableJavaScript",        BOOLEAN, ENABLE_JAVASCRIPT          )
-DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "loadImagesAutomatically", BOOLEAN, LOAD_IMAGES_AUTOMATICALLY  )
-DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "defaultTextEncodingName", STRING,  DEFAULT_TEXT_ENCODING_NAME )
-DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "defaultFontSize",         INTEGER, DEFAULT_FONT_SIZE          )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "scrollPosition",          VECTOR2, SCROLL_POSITION            )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "scrollSize",              VECTOR2, SCROLL_SIZE                )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "contentSize",             VECTOR2, CONTENT_SIZE               )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "title",                   STRING,  TITLE                      )
+DALI_PROPERTY_REGISTRATION( Toolkit, WebView, "videoHoleEnabled",        BOOLEAN, VIDEO_HOLE_ENABLED         )
 
 DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "pageLoadStarted",         PAGE_LOAD_STARTED_SIGNAL            )
 DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "pageLoadFinished",        PAGE_LOAD_FINISHED_SIGNAL           )
 DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "pageLoadError",           PAGE_LOAD_ERROR_SIGNAL              )
+DALI_SIGNAL_REGISTRATION(   Toolkit, WebView, "scrollEdgeReached",       SCROLL_EDGE_REACHED_SIGNAL          )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -97,7 +94,9 @@ WebView::WebView( const std::string& locale, const std::string& timezoneId )
   mWebEngine(),
   mPageLoadStartedSignal(),
   mPageLoadFinishedSignal(),
-  mPageLoadErrorSignal()
+  mPageLoadErrorSignal(),
+  mVideoHoleEnabled( true ),
+  mWebViewArea ( 0, 0, mWebViewSize.width, mWebViewSize.height )
 {
   mWebEngine = Dali::WebEngine::New();
 
@@ -108,6 +107,27 @@ WebView::WebView( const std::string& locale, const std::string& timezoneId )
   }
 }
 
+WebView::WebView( int argc, char** argv )
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS ) ),
+  mUrl(),
+  mVisual(),
+  mWebViewSize( Stage::GetCurrent().GetSize() ),
+  mWebEngine(),
+  mPageLoadStartedSignal(),
+  mPageLoadFinishedSignal(),
+  mPageLoadErrorSignal(),
+  mVideoHoleEnabled( true ),
+  mWebViewArea ( 0, 0, mWebViewSize.width, mWebViewSize.height )
+{
+  mWebEngine = Dali::WebEngine::New();
+
+  // WebEngine is empty when it is not properly initialized.
+  if ( mWebEngine )
+  {
+    mWebEngine.Create( mWebViewSize.width, mWebViewSize.height, argc, argv );
+  }
+}
+
 WebView::WebView()
 : WebView( "", "" )
 {
@@ -115,6 +135,10 @@ WebView::WebView()
 
 WebView::~WebView()
 {
+  if( mWebEngine )
+  {
+    mWebEngine.Destroy();
+  }
 }
 
 Toolkit::WebView WebView::New()
@@ -135,17 +159,74 @@ Toolkit::WebView WebView::New( const std::string& locale, const std::string& tim
   return handle;
 }
 
+Toolkit::WebView WebView::New( int argc, char** argv )
+{
+  WebView* impl = new WebView( argc, argv );
+  Toolkit::WebView handle = Toolkit::WebView( *impl );
+
+  impl->Initialize();
+  return handle;
+}
+
 void WebView::OnInitialize()
 {
-  Self().SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
-  Self().TouchedSignal().Connect( this, &WebView::OnTouchEvent );
+  Actor self = Self();
+
+  self.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
+  self.TouchedSignal().Connect( this, &WebView::OnTouchEvent );
+
+  mPositionUpdateNotification = self.AddPropertyNotification( Actor::Property::WORLD_POSITION, StepCondition( 1.0f, 1.0f ) );
+  mSizeUpdateNotification = self.AddPropertyNotification( Actor::Property::SIZE, StepCondition( 1.0f, 1.0f ) );
+  mScaleUpdateNotification = self.AddPropertyNotification( Actor::Property::WORLD_SCALE, StepCondition( 0.1f, 1.0f ) );
+  mPositionUpdateNotification.NotifySignal().Connect( this, &WebView::UpdateDisplayArea );
+  mSizeUpdateNotification.NotifySignal().Connect( this, &WebView::UpdateDisplayArea );
+  mScaleUpdateNotification.NotifySignal().Connect( this, &WebView::UpdateDisplayArea );
 
   if( mWebEngine )
   {
     mWebEngine.PageLoadStartedSignal().Connect( this, &WebView::OnPageLoadStarted );
     mWebEngine.PageLoadFinishedSignal().Connect( this, &WebView::OnPageLoadFinished );
     mWebEngine.PageLoadErrorSignal().Connect( this, &WebView::OnPageLoadError );
+    mWebEngine.ScrollEdgeReachedSignal().Connect( this, &WebView::OnScrollEdgeReached );
+
+    mWebContext = std::unique_ptr<Dali::Toolkit::WebContext>( new WebContext( mWebEngine.GetContext() ) );
+    mWebCookieManager = std::unique_ptr<Dali::Toolkit::WebCookieManager>( new WebCookieManager( mWebEngine.GetCookieManager() ) );
+    mWebSettings = std::unique_ptr<Dali::Toolkit::WebSettings>( new WebSettings( mWebEngine.GetSettings() ) );
+    mWebBackForwardList = std::unique_ptr<Dali::Toolkit::WebBackForwardList>( new WebBackForwardList( mWebEngine.GetBackForwardList() ) );
+  }
+}
+
+Dali::Toolkit::WebSettings* WebView::GetSettings() const
+{
+  return mWebSettings.get();
+}
+
+Dali::Toolkit::WebContext* WebView::GetContext() const
+{
+  return mWebContext.get();
+}
+
+Dali::Toolkit::WebCookieManager* WebView::GetCookieManager() const
+{
+  return mWebCookieManager.get();
+}
+
+Dali::Toolkit::WebBackForwardList* WebView::GetBackForwardList() const
+{
+  return mWebBackForwardList.get();
+}
+
+Dali::Toolkit::ImageView& WebView::GetFavicon()
+{
+  if ( mWebEngine )
+  {
+    Dali::PixelData pixelData = mWebEngine.GetFavicon();
+    std::string url = Dali::Toolkit::Image::GenerateUrl( pixelData );
+    mFaviconView = Dali::Toolkit::ImageView::New( url );
+    mFaviconView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+    mFaviconView.SetProperty( Dali::Actor::Property::SIZE, Vector2( pixelData.GetWidth(), pixelData.GetHeight() ) );
   }
+  return mFaviconView;
 }
 
 void WebView::LoadUrl( const std::string& url )
@@ -165,10 +246,15 @@ void WebView::LoadUrl( const std::string& url )
       DevelControl::RegisterVisual( *this, Toolkit::WebView::Property::URL, mVisual );
       mWebEngine.LoadUrl( url );
     }
+
+    if ( mVideoHoleEnabled )
+    {
+      EnableBlendMode( false );
+    }
   }
 }
 
-void WebView::LoadHTMLString( const std::string& htmlString )
+void WebView::LoadHtmlString( const std::string& htmlString )
 {
   if( mWebEngine )
   {
@@ -181,7 +267,12 @@ void WebView::LoadHTMLString( const std::string& htmlString )
     if( mVisual )
     {
       DevelControl::RegisterVisual( *this, Toolkit::WebView::Property::URL, mVisual );
-      mWebEngine.LoadHTMLString( htmlString );
+      mWebEngine.LoadHtmlString( htmlString );
+    }
+
+    if ( mVideoHoleEnabled )
+    {
+      EnableBlendMode( false );
     }
   }
 }
@@ -218,6 +309,14 @@ void WebView::Resume()
   }
 }
 
+void WebView::ScrollBy( int deltaX, int deltaY )
+{
+  if ( mWebEngine )
+  {
+    mWebEngine.ScrollBy( deltaX, deltaY );
+  }
+}
+
 bool WebView::CanGoForward()
 {
   return mWebEngine ? mWebEngine.CanGoForward() : false;
@@ -260,6 +359,14 @@ void WebView::AddJavaScriptMessageHandler( const std::string& exposedObjectName,
   }
 }
 
+void WebView::ClearAllTilesResources()
+{
+  if( mWebEngine )
+  {
+    mWebEngine.ClearAllTilesResources();
+  }
+}
+
 void WebView::ClearHistory()
 {
   if( mWebEngine )
@@ -268,19 +375,56 @@ void WebView::ClearHistory()
   }
 }
 
-void WebView::ClearCache()
+void WebView::UpdateDisplayArea( Dali::PropertyNotification& /*source*/ )
 {
-  if( mWebEngine )
+  if( !mWebEngine )
+    return;
+
+  Actor self( Self() );
+
+  bool positionUsesAnchorPoint = self.GetProperty< bool >( Actor::Property::POSITION_USES_ANCHOR_POINT );
+  Vector3 actorSize = self.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) * self.GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
+  Vector3 anchorPointOffSet = actorSize * ( positionUsesAnchorPoint ? self.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ) : AnchorPoint::TOP_LEFT );
+  Vector2 screenPosition = self.GetProperty< Vector2 >( Actor::Property::SCREEN_POSITION );
+
+  Dali::Rect< int > displayArea;
+  displayArea.x = screenPosition.x - anchorPointOffSet.x;
+  displayArea.y = screenPosition.y - anchorPointOffSet.y;
+  displayArea.width = actorSize.x;
+  displayArea.height = actorSize.y;
+
+  Size displaySize = Size( displayArea.width, displayArea.height );
+  if ( mWebViewSize != displaySize )
   {
-    mWebEngine.ClearCache();
+    mWebViewSize = displaySize;
+  }
+
+  if (mWebViewArea != displayArea )
+  {
+    mWebViewArea = displayArea;
+    mWebEngine.UpdateDisplayArea( mWebViewArea );
   }
 }
 
-void WebView::ClearCookies()
+void WebView::EnableVideoHole( bool enabled )
 {
+  mVideoHoleEnabled = enabled;
+
+  EnableBlendMode( !mVideoHoleEnabled );
+
   if( mWebEngine )
   {
-    mWebEngine.ClearCookies();
+    mWebEngine.EnableVideoHole( mVideoHoleEnabled );
+  }
+}
+
+void WebView::EnableBlendMode( bool blendEnabled )
+{
+  Actor self = Self();
+  for (uint32_t i = 0; i < self.GetRendererCount(); i++)
+  {
+    Dali::Renderer render = self.GetRendererAt( i );
+    render.SetProperty( Renderer::Property::BLEND_MODE, blendEnabled ? BlendMode::ON : BlendMode::OFF );
   }
 }
 
@@ -299,6 +443,11 @@ Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType& WebView::PageLoadErrorSi
   return mPageLoadErrorSignal;
 }
 
+Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& WebView::ScrollEdgeReachedSignal()
+{
+  return mScrollEdgeReachedSignal;
+}
+
 void WebView::OnPageLoadStarted( const std::string& url )
 {
   if( !mPageLoadStartedSignal.Empty() )
@@ -326,6 +475,15 @@ void WebView::OnPageLoadError( const std::string& url, int errorCode )
   }
 }
 
+void WebView::OnScrollEdgeReached( Dali::WebEnginePlugin::ScrollEdge edge )
+{
+  if( !mScrollEdgeReachedSignal.Empty() )
+  {
+    Dali::Toolkit::WebView handle( GetOwner() );
+    mScrollEdgeReachedSignal.Emit( handle, edge );
+  }
+}
+
 bool WebView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   Dali::BaseHandle handle( object );
@@ -348,6 +506,11 @@ bool WebView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* t
     webView.PageLoadErrorSignal().Connect( tracker, functor );
     connected = true;
   }
+  else if( 0 == strcmp( signalName.c_str(), SCROLL_EDGE_REACHED_SIGNAL ) )
+  {
+    webView.ScrollEdgeReachedSignal().Connect( tracker, functor );
+    connected = true;
+  }
 
   return connected;
 }
@@ -364,19 +527,11 @@ Vector3 WebView::GetNaturalSize()
   return Vector3( mWebViewSize );
 }
 
-void WebView::OnRelayout( const Vector2& size, RelayoutContainer& container )
+void WebView::OnSceneConnection( int depth )
 {
-  Control::OnRelayout( size, container );
-
-  if( size.width > 0 && size.height > 0 && mWebViewSize != size )
-  {
-    mWebViewSize = size;
+  Control::OnSceneConnection( depth );
 
-    if( mWebEngine )
-    {
-      mWebEngine.SetSize( size.width, size.height );
-    }
-  }
+  EnableBlendMode( !mVideoHoleEnabled );
 }
 
 void WebView::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
@@ -397,20 +552,6 @@ void WebView::SetProperty( BaseObject* object, Property::Index index, const Prop
         }
         break;
       }
-      case Toolkit::WebView::Property::CACHE_MODEL:
-      {
-        Toolkit::WebView::CacheModel::Type output = impl.GetCacheModel();
-        GET_ENUM_VALUE( CacheModel, value, output );
-        impl.SetCacheModel( output );
-        break;
-      }
-      case Toolkit::WebView::Property::COOKIE_ACCEPT_POLICY:
-      {
-        Toolkit::WebView::CookieAcceptPolicy::Type output = impl.GetCookieAcceptPolicy();
-        GET_ENUM_VALUE( CookieAcceptPolicy, value, output );
-        impl.SetCookieAcceptPolicy( output );
-        break;
-      }
       case Toolkit::WebView::Property::USER_AGENT:
       {
         std::string input;
@@ -420,39 +561,21 @@ void WebView::SetProperty( BaseObject* object, Property::Index index, const Prop
         }
         break;
       }
-      case Toolkit::WebView::Property::ENABLE_JAVASCRIPT:
+      case Toolkit::WebView::Property::SCROLL_POSITION:
       {
-        bool input;
-        if( value.Get( input ) )
+        Vector2 input;
+        if ( value.Get( input ) )
         {
-          impl.EnableJavaScript( input );
+          impl.SetScrollPosition( input.x, input.y );
         }
         break;
       }
-      case Toolkit::WebView::Property::LOAD_IMAGES_AUTOMATICALLY:
+      case Toolkit::WebView::Property::VIDEO_HOLE_ENABLED:
       {
         bool input;
         if( value.Get( input ) )
         {
-          impl.LoadImagesAutomatically( input );
-        }
-        break;
-      }
-      case Toolkit::WebView::Property::DEFAULT_TEXT_ENCODING_NAME:
-      {
-        std::string input;
-        if( value.Get( input ) )
-        {
-          impl.SetDefaultTextEncodingName( input );
-        }
-        break;
-      }
-      case Toolkit::WebView::Property::DEFAULT_FONT_SIZE:
-      {
-        int input;
-        if( value.Get( input ) )
-        {
-          impl.SetDefaultFontSize( input );
+          impl.EnableVideoHole( input );
         }
         break;
       }
@@ -476,39 +599,34 @@ Property::Value WebView::GetProperty( BaseObject* object, Property::Index proper
         value = impl.mUrl;
         break;
       }
-      case Toolkit::WebView::Property::CACHE_MODEL:
-      {
-        value = GET_ENUM_STRING( CacheModel, impl.GetCacheModel() );
-        break;
-      }
-      case Toolkit::WebView::Property::COOKIE_ACCEPT_POLICY:
+      case Toolkit::WebView::Property::USER_AGENT:
       {
-        value = GET_ENUM_STRING( CookieAcceptPolicy, impl.GetCookieAcceptPolicy() );
+        value = impl.GetUserAgent();
         break;
       }
-      case Toolkit::WebView::Property::USER_AGENT:
+      case Toolkit::WebView::Property::SCROLL_POSITION:
       {
-        value = impl.GetUserAgent();
+        value = impl.GetScrollPosition();
         break;
       }
-      case Toolkit::WebView::Property::ENABLE_JAVASCRIPT:
+      case Toolkit::WebView::Property::SCROLL_SIZE:
       {
-        value = impl.IsJavaScriptEnabled();
+        value = impl.GetScrollSize();
         break;
       }
-      case Toolkit::WebView::Property::LOAD_IMAGES_AUTOMATICALLY:
+      case Toolkit::WebView::Property::CONTENT_SIZE:
       {
-        value = impl.AreImagesAutomaticallyLoaded();
+        value = impl.GetContentSize();
         break;
       }
-      case Toolkit::WebView::Property::DEFAULT_TEXT_ENCODING_NAME:
+      case Toolkit::WebView::Property::TITLE:
       {
-        value = impl.GetDefaultTextEncodingName();
+        value = impl.GetTitle();
         break;
       }
-      case Toolkit::WebView::Property::DEFAULT_FONT_SIZE:
+      case Toolkit::WebView::Property::VIDEO_HOLE_ENABLED:
       {
-        value = impl.GetDefaultFontSize();
+        value = impl.mVideoHoleEnabled;
         break;
       }
       default:
@@ -561,94 +679,44 @@ void WebView::OnKeyInputFocusLost()
   EmitKeyInputFocusSignal( false ); // Calls back into the Control hence done last.
 }
 
-Toolkit::WebView::CacheModel::Type WebView::GetCacheModel() const
-{
-  return mWebEngine ? static_cast< Toolkit::WebView::CacheModel::Type >( mWebEngine.GetCacheModel() ) : Toolkit::WebView::CacheModel::DOCUMENT_VIEWER;
-}
-
-void WebView::SetCacheModel( Toolkit::WebView::CacheModel::Type cacheModel )
-{
-  if( mWebEngine )
-  {
-    mWebEngine.SetCacheModel( static_cast< WebEnginePlugin::CacheModel >( cacheModel ) );
-  }
-}
-
-Toolkit::WebView::CookieAcceptPolicy::Type WebView::GetCookieAcceptPolicy() const
-{
-  return mWebEngine ? static_cast< Toolkit::WebView::CookieAcceptPolicy::Type >( mWebEngine.GetCookieAcceptPolicy() ) : Toolkit::WebView::CookieAcceptPolicy::NO_THIRD_PARTY;
-}
-
-void WebView::SetCookieAcceptPolicy( Toolkit::WebView::CookieAcceptPolicy::Type policy )
-{
-  if( mWebEngine )
-  {
-    mWebEngine.SetCookieAcceptPolicy( static_cast< WebEnginePlugin::CookieAcceptPolicy >( policy ) );
-  }
-}
-
-const std::string& WebView::GetUserAgent() const
-{
-  return mWebEngine ? mWebEngine.GetUserAgent() : kEmptyString;
-}
-
-void WebView::SetUserAgent( const std::string& userAgent )
+void WebView::SetScrollPosition( int x, int y )
 {
   if( mWebEngine )
   {
-    mWebEngine.SetUserAgent( userAgent );
+    mWebEngine.SetScrollPosition( x, y );
   }
 }
 
-bool WebView::IsJavaScriptEnabled() const
+Dali::Vector2 WebView::GetScrollPosition() const
 {
-  return mWebEngine ? mWebEngine.IsJavaScriptEnabled() : true;
+  return mWebEngine ? mWebEngine.GetScrollPosition() : Dali::Vector2::ZERO;
 }
 
-void WebView::EnableJavaScript( bool enabled )
+Dali::Vector2 WebView::GetScrollSize() const
 {
-  if( mWebEngine )
-  {
-    mWebEngine.EnableJavaScript( enabled );
-  }
+  return mWebEngine ? mWebEngine.GetScrollSize() : Dali::Vector2::ZERO;
 }
 
-bool WebView::AreImagesAutomaticallyLoaded() const
+Dali::Vector2 WebView::GetContentSize() const
 {
-  return mWebEngine ? mWebEngine.AreImagesAutomaticallyLoaded() : true;
-}
-
-void WebView::LoadImagesAutomatically( bool automatic )
-{
-  if( mWebEngine )
-  {
-    mWebEngine.LoadImagesAutomatically( automatic );
-  }
+  return mWebEngine ? mWebEngine.GetContentSize() : Dali::Vector2::ZERO;
 }
 
-const std::string& WebView::GetDefaultTextEncodingName() const
+std::string WebView::GetTitle() const
 {
-  return mWebEngine ? mWebEngine.GetDefaultTextEncodingName() : kEmptyString;
+  return mWebEngine ?  mWebEngine.GetTitle() : kEmptyString;
 }
 
-void WebView::SetDefaultTextEncodingName( const std::string& defaultTextEncodingName )
-{
-  if( mWebEngine )
-  {
-    mWebEngine.SetDefaultTextEncodingName( defaultTextEncodingName );
-  }
-}
-
-int WebView::GetDefaultFontSize() const
+const std::string& WebView::GetUserAgent() const
 {
-  return mWebEngine ? mWebEngine.GetDefaultFontSize() : 0;
+  return mWebEngine ? mWebEngine.GetUserAgent() : kEmptyString;
 }
 
-void WebView::SetDefaultFontSize( int defaultFontSize )
+void WebView::SetUserAgent( const std::string& userAgent )
 {
   if( mWebEngine )
   {
-    mWebEngine.SetDefaultFontSize( defaultFontSize );
+    mWebEngine.SetUserAgent( userAgent );
   }
 }