X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fweb-view%2Fweb-view-impl.cpp;h=1c9d9392eb685a552695aff68d5305a5519a1c9f;hb=02557f62f8d171115d885c87c138faec2a3cb923;hp=7bdb61dd2fd76fa7de7b4cebf59200202ecc51bb;hpb=fca202af829a0657805e44461f08f284cdbf0bbb;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp index 7bdb61d..1c9d939 100644 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -22,15 +22,16 @@ #include #include #include -#include -#include +#include #include #include #include // INTERNAL INCLUDES #include +#include #include +#include namespace Dali { @@ -137,7 +138,7 @@ Toolkit::WebView WebView::New( const std::string& locale, const std::string& tim void WebView::OnInitialize() { Self().SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); - Self().TouchSignal().Connect( this, &WebView::OnTouchEvent ); + Self().TouchedSignal().Connect( this, &WebView::OnTouchEvent ); if( mWebEngine ) { @@ -152,8 +153,11 @@ void WebView::LoadUrl( const std::string& url ) mUrl = url; if( mWebEngine ) { - Dali::Image image = Dali::NativeImage::New( *mWebEngine.GetNativeImageSource() ); - mVisual = Toolkit::VisualFactory::Get().CreateVisual( image ); + Texture texture = Dali::Texture::New( *mWebEngine.GetNativeImageSource() ); + const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture( texture ); + mVisual = Toolkit::VisualFactory::Get().CreateVisual( + { { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE } , + { Toolkit::ImageVisual::Property::URL, nativeImageUrl } } ); if( mVisual ) { @@ -168,8 +172,11 @@ void WebView::LoadHTMLString( const std::string& htmlString ) { if( mWebEngine ) { - Dali::Image image = Dali::NativeImage::New( *mWebEngine.GetNativeImageSource() ); - mVisual = Toolkit::VisualFactory::Get().CreateVisual( image ); + Texture texture = Dali::Texture::New( *mWebEngine.GetNativeImageSource() ); + const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture( texture ); + mVisual = Toolkit::VisualFactory::Get().CreateVisual( + { { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE } , + { Toolkit::ImageVisual::Property::URL, nativeImageUrl } } ); if( mVisual ) { @@ -512,7 +519,7 @@ Property::Value WebView::GetProperty( BaseObject* object, Property::Index proper return value; } -bool WebView::OnTouchEvent( Actor actor, const Dali::TouchData& touch ) +bool WebView::OnTouchEvent( Actor actor, const Dali::TouchEvent& touch ) { bool result = false; @@ -534,6 +541,26 @@ bool WebView::OnKeyEvent( const Dali::KeyEvent& event ) return result; } +void WebView::OnKeyInputFocusGained() +{ + if( mWebEngine ) + { + mWebEngine.SetFocus( true ); + } + + EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last. +} + +void WebView::OnKeyInputFocusLost() +{ + if( mWebEngine ) + { + mWebEngine.SetFocus( false ); + } + + 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;