Add APIs for showing/hiding context menu. 43/260243/6
authorhuayong.xu <huayong.xu@samsung.com>
Tue, 22 Jun 2021 08:56:45 +0000 (16:56 +0800)
committerhuayong.xu <huayong.xu@samsung.com>
Mon, 5 Jul 2021 03:08:24 +0000 (11:08 +0800)
1) Remove APIs for customizing context menu and selecting some menu
   item.
2) Rename some APIs in web context.

Change-Id: I89adad1a891f4eb077e06d3dfaa83982a7247095

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-context.cpp
dali-toolkit/devel-api/controls/web-view/web-context.h
dali-toolkit/devel-api/controls/web-view/web-view.cpp
dali-toolkit/devel-api/controls/web-view/web-view.h
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.h

index b30d3b6..ec13bcb 100755 (executable)
@@ -118,6 +118,22 @@ public:
 
   void SetProxyUri( const std::string& uri ) override
   {
+    mockProxyUri = uri;
+  }
+
+  std::string GetProxyUri() const override
+  {
+    return mockProxyUri;
+  }
+
+  void SetProxyBypassRule(const std::string& proxy, const std::string& bypass) override
+  {
+    mockBypassRule = bypass;
+  }
+
+  std::string GetProxyBypassRule() const override
+  {
+    return mockBypassRule;
   }
 
   void SetDefaultProxyAuth( const std::string& username, const std::string& password ) override
@@ -126,6 +142,12 @@ public:
 
   void SetCertificateFilePath( const std::string& certificatePath ) override
   {
+    mockCertificateFilePath = certificatePath;
+  }
+
+  std::string GetCertificateFilePath() const override
+  {
+    return mockCertificateFilePath;
   }
 
   void DeleteAllWebDatabase() override
@@ -218,36 +240,32 @@ public:
 
   void EnableCache( bool cacheEnabled ) override
   {
+    mockCacheEnabled = cacheEnabled;
   }
 
   bool IsCacheEnabled() const override
   {
-    return true;
+    return mockCacheEnabled;
   }
 
-  std::string GetContextCertificateFile() const override
+  void SetAppId(const std::string& appID) override
   {
-    return "test";
   }
 
-  void SetContextAppId(const std::string& appID) override
-  {
-  }
-
-  bool SetContextAppVersion(const std::string& appVersion) override
+  bool SetAppVersion(const std::string& appVersion) override
   {
     return true;
   }
 
-  void SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType) override
+  void SetApplicationType(const Dali::WebEngineContext::ApplicationType applicationType) override
   {
   }
 
-  void SetContextTimeOffset(float timeOffset) override
+  void SetTimeOffset(float timeOffset) override
   {
   }
 
-  void SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime) override
+  void SetTimeZoneOffset(float timeZoneOffset, float daylightSavingTime) override
   {
   }
 
@@ -261,11 +279,12 @@ public:
 
   void SetDefaultZoomFactor(float zoomFactor) override
   {
+    mockZoomFactor = zoomFactor;
   }
 
-  float GetContextDefaultZoomFactor() const override
+  float GetDefaultZoomFactor() const override
   {
-    return 0;
+    return mockZoomFactor;
   }
 
   bool DeleteAllApplicationCache() override
@@ -290,20 +309,6 @@ public:
   {
   }
 
-  std::string GetContextProxy() const override
-  {
-    return "test";
-  }
-
-  void SetContextProxy(const std::string& proxy, const std::string& bypass) override
-  {
-  }
-
-  std::string GetProxyBypassRule() const override
-  {
-    return "test";
-  }
-
   bool FreeUnusedMemory() override
   {
     return true;
@@ -318,6 +323,11 @@ public:
 
 private:
   Dali::WebEngineContext::CacheModel mockModel;
+  std::string                        mockProxyUri;
+  std::string                        mockBypassRule;
+  std::string                        mockCertificateFilePath;
+  bool                               mockCacheEnabled;
+  float                              mockZoomFactor;
 };
 
 class MockWebEngineCookieManager : public Dali::WebEngineCookieManager
@@ -751,11 +761,6 @@ public:
     return result;
   }
 
-  Dali::Vector2 GetPosition() const override
-  {
-    return Dali::Vector2(100, 100);
-  }
-
   bool RemoveItem(WebEngineContextMenuItem& item) override
   {
     return true;
@@ -1217,7 +1222,7 @@ public:
     ConnectToGlobalSignal( &OnLoadUrl );
   }
 
-  const std::string& GetUrl() const
+  std::string GetUrl() const
   {
     return mUrl;
   }
@@ -1325,7 +1330,7 @@ public:
     ConnectToGlobalSignal( &OnClearHistory );
   }
 
-  const std::string& GetUserAgent() const
+  std::string GetUserAgent() const
   {
     return mUserAgent;
   }
@@ -1519,14 +1524,14 @@ public:
     return mHttpAuthHandlerSignal;
   }
 
-  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& ContextMenuCustomizedSignal()
+  Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType& ContextMenuShownSignal()
   {
-    return mContextMenuCustomizedSignal;
+    return mContextMenuShownSignal;
   }
 
-  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal()
+  Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType& ContextMenuHiddenSignal()
   {
-    return mContextMenuItemSelectedSignal;
+    return mContextMenuHiddenSignal;
   }
 
   std::string              mUrl;
@@ -1534,22 +1539,22 @@ public:
   size_t                   mCurrentPlusOnePos;
   std::string              mUserAgent;
 
-  Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadStartedSignal;
-  Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadInProgressSignal;
-  Dali::WebEnginePlugin::WebEnginePageLoadSignalType                mPageLoadFinishedSignal;
-  Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType           mPageLoadErrorSignal;
-  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType       mScrollEdgeReachedSignal;
-  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType              mUrlChangedSignal;
-  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType      mFormRepostDecisionSignal;
-  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType           mFrameRenderedSignal;
-  Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType      mRequestInterceptorSignal;
-  Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType          mConsoleMessageSignal;
-  Dali::WebEnginePlugin::WebEngineResponsePolicyDecisionSignalType  mResponsePolicyDecisionSignal;
-  Dali::WebEnginePlugin::WebEngineCertificateSignalType             mCertificateConfirmSignal;
-  Dali::WebEnginePlugin::WebEngineCertificateSignalType             mSslCertificateChangedSignal;
-  Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType         mHttpAuthHandlerSignal;
-  Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType   mContextMenuCustomizedSignal;
-  Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType mContextMenuItemSelectedSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType               mPageLoadStartedSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType               mPageLoadInProgressSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadSignalType               mPageLoadFinishedSignal;
+  Dali::WebEnginePlugin::WebEnginePageLoadErrorSignalType          mPageLoadErrorSignal;
+  Dali::WebEnginePlugin::WebEngineScrollEdgeReachedSignalType      mScrollEdgeReachedSignal;
+  Dali::WebEnginePlugin::WebEngineUrlChangedSignalType             mUrlChangedSignal;
+  Dali::WebEnginePlugin::WebEngineFormRepostDecisionSignalType     mFormRepostDecisionSignal;
+  Dali::WebEnginePlugin::WebEngineFrameRenderedSignalType          mFrameRenderedSignal;
+  Dali::WebEnginePlugin::WebEngineRequestInterceptorSignalType     mRequestInterceptorSignal;
+  Dali::WebEnginePlugin::WebEngineConsoleMessageSignalType         mConsoleMessageSignal;
+  Dali::WebEnginePlugin::WebEngineResponsePolicyDecisionSignalType mResponsePolicyDecisionSignal;
+  Dali::WebEnginePlugin::WebEngineCertificateSignalType            mCertificateConfirmSignal;
+  Dali::WebEnginePlugin::WebEngineCertificateSignalType            mSslCertificateChangedSignal;
+  Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType        mHttpAuthHandlerSignal;
+  Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType       mContextMenuShownSignal;
+  Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType      mContextMenuHiddenSignal;
 
   bool  mEvaluating;
   float mPageZoomFactor;
@@ -1638,9 +1643,9 @@ bool OnLoadUrl()
     gInstance->mHttpAuthHandlerSignal.Emit(std::move(handler));
 
     std::shared_ptr<Dali::WebEngineContextMenu> menu(new MockWebEngineContextMenu());
-    gInstance->mContextMenuCustomizedSignal.Emit(std::move(menu));
-    std::shared_ptr<Dali::WebEngineContextMenuItem> item(new MockWebEngineContextMenuItem());
-    gInstance->mContextMenuItemSelectedSignal.Emit(std::move(item));
+    gInstance->mContextMenuShownSignal.Emit(std::move(menu));
+    std::shared_ptr<Dali::WebEngineContextMenu> hiddenMenu(new MockWebEngineContextMenu());
+    gInstance->mContextMenuHiddenSignal.Emit(std::move(hiddenMenu));
   }
   return false;
 }
@@ -1941,7 +1946,7 @@ Dali::PixelData WebEngine::GetFavicon() const
   return Internal::Adaptor::GetImplementation( *this ).GetFavicon();
 }
 
-const std::string& WebEngine::GetUrl()
+std::string WebEngine::GetUrl() const
 {
   return Internal::Adaptor::GetImplementation( *this ).GetUrl();
 }
@@ -2134,7 +2139,7 @@ void WebEngine::RegisterGeolocationPermissionCallback(Dali::WebEnginePlugin::Geo
   Internal::Adaptor::GetImplementation( *this ).RegisterGeolocationPermissionCallback(callback);
 }
 
-const std::string& WebEngine::GetUserAgent() const
+std::string WebEngine::GetUserAgent() const
 {
   return Internal::Adaptor::GetImplementation( *this ).GetUserAgent();
 }
@@ -2334,14 +2339,14 @@ Dali::WebEnginePlugin::WebEngineHttpAuthHandlerSignalType& WebEngine::HttpAuthHa
   return Internal::Adaptor::GetImplementation(*this).HttpAuthHandlerSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineContextMenuCustomizedSignalType& WebEngine::ContextMenuCustomizedSignal()
+Dali::WebEnginePlugin::WebEngineContextMenuShownSignalType& WebEngine::ContextMenuShownSignal()
 {
-  return Internal::Adaptor::GetImplementation( *this ).ContextMenuCustomizedSignal();
+  return Internal::Adaptor::GetImplementation( *this ).ContextMenuShownSignal();
 }
 
-Dali::WebEnginePlugin::WebEngineContextMenuItemSelectedSignalType& WebEngine::ContextMenuItemSelectedSignal()
+Dali::WebEnginePlugin::WebEngineContextMenuHiddenSignalType& WebEngine::ContextMenuHiddenSignal()
 {
-  return Internal::Adaptor::GetImplementation( *this ).ContextMenuItemSelectedSignal();
+  return Internal::Adaptor::GetImplementation( *this ).ContextMenuHiddenSignal();
 }
 
 } // namespace Dali;
index 4fbe8c1..36258d4 100755 (executable)
@@ -96,10 +96,10 @@ static int gDownloadStartedCallbackCalled = 0;
 static int gMimeOverriddenCallbackCalled = 0;
 static std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> gSecurityOriginList;
 static std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> gPasswordDataList;
-static int gContextMenuCustomizedCallbackCalled = 0;
-static std::shared_ptr<Dali::WebEngineContextMenu> gContextMenuInstance = nullptr;
-static int gContextMenuItemSelectedCallbackCalled = 0;
-static std::shared_ptr<Dali::WebEngineContextMenuItem> gContextMenuItemInstance = nullptr;
+static int gContextMenuShownCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineContextMenu> gContextMenuShownInstance = nullptr;
+static int gContextMenuHiddenCallbackCalled = 0;
+static std::shared_ptr<Dali::WebEngineContextMenu> gContextMenuHiddenInstance = nullptr;
 static int gHitTestCreatedCallbackCalled = 0;
 static int gCookieManagerChangsWatchCallbackCalled = 0;
 
@@ -293,16 +293,16 @@ static bool OnMimeOverridden(const std::string&, const std::string&, std::string
   return false;
 }
 
-static void OnContextMenuCustomized(WebView view, std::shared_ptr<Dali::WebEngineContextMenu> menu)
+static void OnContextMenuShown(WebView view, std::shared_ptr<Dali::WebEngineContextMenu> menu)
 {
-  gContextMenuCustomizedCallbackCalled++;
-  gContextMenuInstance = std::move(menu);
+  gContextMenuShownCallbackCalled++;
+  gContextMenuShownInstance = std::move(menu);
 }
 
-static void OnContextMenuItemSelected(WebView view, std::shared_ptr<Dali::WebEngineContextMenuItem> item)
+static void OnContextMenuHidden(WebView view, std::shared_ptr<Dali::WebEngineContextMenu> menu)
 {
-  gContextMenuItemSelectedCallbackCalled++;
-  gContextMenuItemInstance = std::move(item);
+  gContextMenuHiddenCallbackCalled++;
+  gContextMenuHiddenInstance = std::move(menu);
 }
 
 } // namespace
@@ -1072,7 +1072,7 @@ int UtcDaliWebViewPropertyTitleFavicon(void)
   END_TEST;
 }
 
-int UtcDaliWebViewContextMenuCustomizedAndItemSelected(void)
+int UtcDaliWebViewContextMenuShownAndHidden(void)
 {
   ToolkitTestApplication application;
 
@@ -1081,54 +1081,53 @@ int UtcDaliWebViewContextMenuCustomizedAndItemSelected(void)
 
   // load url.
   ConnectionTracker* testTracker = new ConnectionTracker();
-  view.ContextMenuCustomizedSignal().Connect( &OnContextMenuCustomized );
-  view.ContextMenuItemSelectedSignal().Connect( &OnContextMenuItemSelected );
+  view.ContextMenuShownSignal().Connect( &OnContextMenuShown );
+  view.ContextMenuHiddenSignal().Connect( &OnContextMenuHidden );
   bool signal1 = false;
   bool signal2 = false;
-  view.ConnectSignal( testTracker, "contextMenuCustomized", CallbackFunctor(&signal1) );
-  view.ConnectSignal( testTracker, "contextMenuItemSelected", CallbackFunctor(&signal2) );
-  DALI_TEST_EQUALS( gContextMenuCustomizedCallbackCalled, 0, TEST_LOCATION );
-  DALI_TEST_EQUALS( gContextMenuItemSelectedCallbackCalled, 0, TEST_LOCATION );
-  DALI_TEST_CHECK(gContextMenuInstance == 0);
-  DALI_TEST_CHECK(gContextMenuItemInstance == 0);
+  view.ConnectSignal( testTracker, "contextMenuShown", CallbackFunctor(&signal1) );
+  view.ConnectSignal( testTracker, "contextMenuHidden", CallbackFunctor(&signal2) );
+  DALI_TEST_EQUALS( gContextMenuShownCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuHiddenCallbackCalled, 0, TEST_LOCATION );
+  DALI_TEST_CHECK(gContextMenuShownInstance == 0);
+  DALI_TEST_CHECK(gContextMenuHiddenInstance == 0);
 
   view.LoadUrl( TEST_URL1 );
   Test::EmitGlobalTimerSignal();
-  DALI_TEST_EQUALS( gContextMenuCustomizedCallbackCalled, 1, TEST_LOCATION );
-  DALI_TEST_EQUALS( gContextMenuItemSelectedCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuShownCallbackCalled, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( gContextMenuHiddenCallbackCalled, 1, TEST_LOCATION );
   DALI_TEST_CHECK( signal1 );
   DALI_TEST_CHECK( signal2 );
 
   // check context meun & its items.
-  DALI_TEST_CHECK(gContextMenuInstance != 0);
-  std::unique_ptr<Dali::WebEngineContextMenuItem> item = gContextMenuInstance->GetItemAt(0);
+  DALI_TEST_CHECK(gContextMenuShownInstance != 0);
+  std::unique_ptr<Dali::WebEngineContextMenuItem> item = gContextMenuShownInstance->GetItemAt(0);
   DALI_TEST_CHECK(item.get() != 0);
-  std::vector<std::unique_ptr<Dali::WebEngineContextMenuItem>> itemList = gContextMenuInstance->GetItemList();
+  std::vector<std::unique_ptr<Dali::WebEngineContextMenuItem>> itemList = gContextMenuShownInstance->GetItemList();
   DALI_TEST_CHECK(itemList.size() == 1);
-  Dali::Vector2 testPosition = Dali::Vector2(100, 100);
-  DALI_TEST_EQUALS(gContextMenuInstance->GetPosition(), testPosition, TEST_LOCATION);
-  DALI_TEST_CHECK(gContextMenuInstance->RemoveItem(*(item.get())));
-  DALI_TEST_CHECK(gContextMenuInstance->AppendItemAsAction(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", false));
-  DALI_TEST_CHECK(gContextMenuInstance->AppendItem(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", "", false));
-  DALI_TEST_CHECK(gContextMenuInstance->SelectItem(*(item.get())));
-  DALI_TEST_CHECK(gContextMenuInstance->Hide());
-
-  DALI_TEST_CHECK(gContextMenuItemInstance != 0);
+  DALI_TEST_CHECK(gContextMenuShownInstance->RemoveItem(*(item.get())));
+  DALI_TEST_CHECK(gContextMenuShownInstance->AppendItemAsAction(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", false));
+  DALI_TEST_CHECK(gContextMenuShownInstance->AppendItem(WebEngineContextMenuItem::ItemTag::NO_ACTION, "", "", false));
+  DALI_TEST_CHECK(gContextMenuShownInstance->SelectItem(*(item.get())));
+  DALI_TEST_CHECK(gContextMenuShownInstance->Hide());
+
   Dali::WebEngineContextMenuItem::ItemTag testItemTag = Dali::WebEngineContextMenuItem::ItemTag::NO_ACTION;
-  DALI_TEST_EQUALS(gContextMenuItemInstance->GetTag(), testItemTag, TEST_LOCATION);
+  DALI_TEST_EQUALS(item->GetTag(), testItemTag, TEST_LOCATION);
   Dali::WebEngineContextMenuItem::ItemType testItemType = Dali::WebEngineContextMenuItem::ItemType::ACTION;
-  DALI_TEST_EQUALS(gContextMenuItemInstance->GetType(), testItemType, TEST_LOCATION);
-  DALI_TEST_CHECK(gContextMenuItemInstance->IsEnabled());
+  DALI_TEST_EQUALS(item->GetType(), testItemType, TEST_LOCATION);
+  DALI_TEST_CHECK(item->IsEnabled());
   std::string testLinkUrl("http://test.html");
-  DALI_TEST_EQUALS(gContextMenuItemInstance->GetLinkUrl(), testLinkUrl, TEST_LOCATION);
+  DALI_TEST_EQUALS(item->GetLinkUrl(), testLinkUrl, TEST_LOCATION);
   std::string testImageUrl("http://test.jpg");
-  DALI_TEST_EQUALS(gContextMenuItemInstance->GetImageUrl(), testImageUrl, TEST_LOCATION);
+  DALI_TEST_EQUALS(item->GetImageUrl(), testImageUrl, TEST_LOCATION);
   std::string testTitle("title");
-  DALI_TEST_EQUALS(gContextMenuItemInstance->GetTitle(), testTitle, TEST_LOCATION);
-  DALI_TEST_CHECK(gContextMenuItemInstance->GetParentMenu().get() == 0);
+  DALI_TEST_EQUALS(item->GetTitle(), testTitle, TEST_LOCATION);
+  DALI_TEST_CHECK(item->GetParentMenu().get() == 0);
+
+  DALI_TEST_CHECK(gContextMenuHiddenInstance != 0);
 
-  gContextMenuInstance = nullptr;
-  gContextMenuItemInstance = nullptr;
+  gContextMenuShownInstance = nullptr;
+  gContextMenuHiddenInstance = nullptr;
 
   END_TEST;
 }
@@ -1585,19 +1584,15 @@ int UtcDaliWebContextGetSetCacheModel(void)
   std::string kDefaultValue;
 
   // Reset something
-  context->SetProxyUri( kDefaultValue );
-  context->SetCertificateFilePath( kDefaultValue );
-  context->EnableCache( true );
+  context->SetAppId( "id" );
+  context->SetApplicationType( Dali::WebEngineContext::ApplicationType::OTHER );
+  context->SetTimeOffset( 0 );
+  context->SetTimeZoneOffset( 0, 0 );
   context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
   context->DeleteAllWebDatabase();
   context->DeleteAllWebStorage();
   context->DeleteLocalFileSystem();
   context->ClearCache();
-  context->SetContextAppId( "id" );
-  context->SetContextApplicationType( Dali::WebEngineContext::ApplicationType::OTHER );
-  context->SetContextTimeOffset( 0 );
-  context->SetContextTimeZoneOffset( 0, 0 );
-  context->SetDefaultZoomFactor( 0 );
   context->DeleteAllFormPasswordData();
   context->DeleteAllFormCandidateData();
 
@@ -1611,14 +1606,16 @@ int UtcDaliWebContextGetSetCacheModel(void)
   DALI_TEST_CHECK( value == Dali::WebEngineContext::CacheModel::DOCUMENT_BROWSER );
 
   // Get cache enabled
+  context->EnableCache( true );
   DALI_TEST_CHECK( context->IsCacheEnabled() );
 
   // Get certificate
-  std::string str = context->GetContextCertificateFile();
+  context->SetCertificateFilePath( "test" );
+  std::string str = context->GetCertificateFilePath();
   DALI_TEST_EQUALS( str, "test", TEST_LOCATION );
 
   // Set version
-  DALI_TEST_CHECK( context->SetContextAppVersion( "test" ) );
+  DALI_TEST_CHECK( context->SetAppVersion( "test" ) );
 
   // Register
   std::vector<std::string> temp;
@@ -1626,16 +1623,18 @@ int UtcDaliWebContextGetSetCacheModel(void)
   context->RegisterJsPluginMimeTypes( temp );
   context->DeleteFormPasswordDataList( temp );
 
-  // Get zoom
-  DALI_TEST_EQUALS( context->GetContextDefaultZoomFactor(), float( 0 ), TEST_LOCATION );
+  // Get zoom factor
+  context->SetDefaultZoomFactor( 1.0f );
+  DALI_TEST_EQUALS( context->GetDefaultZoomFactor(), float( 1.0f ), TEST_LOCATION );
 
   // Delete cache and database
   DALI_TEST_CHECK( context->DeleteAllApplicationCache() );
   DALI_TEST_CHECK( context->DeleteAllWebIndexedDatabase() );
 
   // Get contextProxy
-  context->SetContextProxy("", "");
-  DALI_TEST_EQUALS( context->GetContextProxy(), "test", TEST_LOCATION );
+  context->SetProxyUri( "test" );
+  DALI_TEST_EQUALS( context->GetProxyUri(), "test", TEST_LOCATION );
+  context->SetProxyBypassRule("", "test");
   DALI_TEST_EQUALS( context->GetProxyBypassRule(), "test", TEST_LOCATION );
 
   //Notify low memory
index 2a7090b..12218f7 100755 (executable)
@@ -49,11 +49,31 @@ void WebContext::SetProxyUri(const std::string& uri)
   mWebEngineContext.SetProxyUri(uri);
 }
 
+std::string WebContext::GetProxyUri() const
+{
+  return mWebEngineContext.GetProxyUri();
+}
+
+void WebContext::SetProxyBypassRule(const std::string& proxy, const std::string& bypass)
+{
+  mWebEngineContext.SetProxyBypassRule(proxy, bypass);
+}
+
+std::string WebContext::GetProxyBypassRule() const
+{
+  return mWebEngineContext.GetProxyBypassRule();
+}
+
 void WebContext::SetCertificateFilePath(const std::string& certificatePath)
 {
   mWebEngineContext.SetCertificateFilePath(certificatePath);
 }
 
+std::string WebContext::GetCertificateFilePath() const
+{
+  return mWebEngineContext.GetCertificateFilePath();
+}
+
 void WebContext::SetDefaultProxyAuth(const std::string& username, const std::string& password)
 {
   mWebEngineContext.SetDefaultProxyAuth(username, password);
@@ -134,34 +154,39 @@ bool WebContext::IsCacheEnabled() const
   return mWebEngineContext.IsCacheEnabled();
 }
 
-std::string WebContext::GetContextCertificateFile() const
+void WebContext::SetAppId(const std::string& appId)
 {
-  return mWebEngineContext.GetContextCertificateFile();
+  mWebEngineContext.SetAppId(appId);
 }
 
-void WebContext::SetContextAppId(const std::string& appID)
+bool WebContext::SetAppVersion(const std::string& appVersion)
 {
-  mWebEngineContext.SetContextAppId(appID);
+  return mWebEngineContext.SetAppVersion(appVersion);
 }
 
-bool WebContext::SetContextAppVersion(const std::string& appVersion)
+void WebContext::SetApplicationType(const Dali::WebEngineContext::ApplicationType applicationType)
 {
-  return mWebEngineContext.SetContextAppVersion(appVersion);
+  mWebEngineContext.SetApplicationType(applicationType);
 }
 
-void WebContext::SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType)
+void WebContext::SetTimeOffset(float timeOffset)
 {
-  mWebEngineContext.SetContextApplicationType(applicationType);
+  mWebEngineContext.SetTimeOffset(timeOffset);
 }
 
-void WebContext::SetContextTimeOffset(float timeOffset)
+void WebContext::SetTimeZoneOffset(float timeZoneOffset, float daylightSavingTime)
 {
-  mWebEngineContext.SetContextTimeOffset(timeOffset);
+  mWebEngineContext.SetTimeZoneOffset(timeZoneOffset, daylightSavingTime);
+}
+
+void WebContext::SetDefaultZoomFactor(float zoomFactor)
+{
+  mWebEngineContext.SetDefaultZoomFactor(zoomFactor);
 }
 
-void WebContext::SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime)
+float WebContext::GetDefaultZoomFactor() const
 {
-  mWebEngineContext.SetContextTimeZoneOffset(timeZoneOffset, daylightSavingTime);
+  return mWebEngineContext.GetDefaultZoomFactor();
 }
 
 void WebContext::RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes)
@@ -174,16 +199,6 @@ void WebContext::RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeT
   mWebEngineContext.RegisterJsPluginMimeTypes(mimeTypes);
 }
 
-void WebContext::SetDefaultZoomFactor(float zoomFactor)
-{
-  mWebEngineContext.SetDefaultZoomFactor(zoomFactor);
-}
-
-float WebContext::GetContextDefaultZoomFactor() const
-{
-  return mWebEngineContext.GetContextDefaultZoomFactor();
-}
-
 bool WebContext::DeleteAllApplicationCache()
 {
   return mWebEngineContext.DeleteAllApplicationCache();
@@ -209,21 +224,6 @@ void WebContext::DeleteAllFormCandidateData()
   mWebEngineContext.DeleteAllFormCandidateData();
 }
 
-std::string WebContext::GetContextProxy() const
-{
-  return mWebEngineContext.GetContextProxy();
-}
-
-void WebContext::SetContextProxy(const std::string& proxy, const std::string& bypass)
-{
-  mWebEngineContext.SetContextProxy(proxy, bypass);
-}
-
-std::string WebContext::GetProxyBypassRule() const
-{
-  return mWebEngineContext.GetProxyBypassRule();
-}
-
 bool WebContext::FreeUnusedMemory()
 {
   return mWebEngineContext.FreeUnusedMemory();
index 531ec00..56bf2d8 100755 (executable)
@@ -79,6 +79,28 @@ public:
   void SetProxyUri(const std::string& uri);
 
   /**
+   * @brief Get the proxy URI from the network backend of specific context.
+   *
+   * @return current proxy URI or null string if it's not set
+   */
+  std::string GetProxyUri() const;
+
+  /**
+   * @brief Set the given proxy to network backend of specific context.
+   *
+   * @param[in] proxy URI to set
+   * @param[in] bypass rule to set
+   */
+  void SetProxyBypassRule(const std::string& proxy, const std::string& bypass);
+
+  /**
+   * @brief Get the proxy bypass rule from the network backend of specific context.
+   *
+   * @return current proxy bypass rule or null string if it's not set
+   */
+  std::string GetProxyBypassRule() const;
+
+  /**
    * @brief Add CA certificates to persistent NSS certificate database
    *
    * Function accepts a path to a CA certificate file, a path to a directory
@@ -91,6 +113,15 @@ public:
   void SetCertificateFilePath(const std::string& certificatePath);
 
   /**
+   * @brief Get CA certifcate file path
+   *
+   * It returns an internal string and should not be modified.
+   *
+   * @return certificate_file path which is set during ewk_context_certificate_file_set or null string otherwise
+   */
+  std::string GetCertificateFilePath() const;
+
+  /**
    * @brief Set a proxy auth credential to network backend of specific context.
    *
    * @param[in] username username to set
@@ -207,34 +238,25 @@ public:
   /**
    * @brief Query if the cache is enabled
    *
-   * @return @c true is cache is enabled or @c false otherwise
+   * @return true is cache is enabled or false otherwise
    */
   bool IsCacheEnabled() const;
 
   /**
-   * @brief Get CA certifcate file path
-   *
-   * It returns an internal string and should not be modified.
+   * @brief Set application id for context.
    *
-   * @return @c certificate_file is path which is set during ewk_context_certificate_file_set or @c null string otherwise
+   * @param[in] appId application id
    */
-  std::string GetContextCertificateFile() const;
+  void SetAppId(const std::string& appId);
 
   /**
-   * @brief Set application id for @a context.
-   *
-   * @param[in] appID application id
-   */
-  void SetContextAppId(const std::string& appID);
-
-  /**
-   * @brief Set application version for @a context.
+   * @brief Set application version for context.
    *
    * @param[in] appVersion application version
    *
-   * @return @c true if successful, @c false otherwise
+   * @return true if successful, false otherwise
    */
-  bool SetContextAppVersion(const std::string& appVersion);
+  bool SetAppVersion(const std::string& appVersion);
 
   /**
    * @brief To declare application type
@@ -242,14 +264,14 @@ public:
    * @param[in] applicationType The Application_Type enum
    *
    */
-  void SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType);
+  void SetApplicationType(const Dali::WebEngineContext::ApplicationType applicationType);
 
   /**
    * @brief Set time offset
    *
    * @param[in] timeOffset The value will be added to system time as offset
    */
-  void SetContextTimeOffset(float timeOffset);
+  void SetTimeOffset(float timeOffset);
 
   /**
    * @brief Set timezone offset
@@ -257,39 +279,39 @@ public:
    * @param[in] timeZoneOffset offset for time zone.
    * @param[in] daylightSavingTime The value is for daylight saving time use.
    */
-  void SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime);
+  void SetTimeZoneOffset(float timeZoneOffset, float daylightSavingTime);
 
   /**
-   * @brief Register url schemes as CORS enabled
-   *
-   * @param[in] schemes The URL schemes list which will be added to web security policy
+   * @brief Set default zoom factor
    *
+   * @param[in] zoomFactor default zoom factor
    */
-  void RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes);
+  void SetDefaultZoomFactor(float zoomFactor);
 
   /**
-   * @brief Register JS plugin mime types.
+   * @brief Get default zoom factor
    *
-   * @param[in] mimeTypes The MIME types will be checked by the renderer frame loader
-   * to skip creating default frame for the object tags with the registered MIME type.
+   * Gets default zoom factor for all pages opened with this context.
+   *
+   * @return default zoom factor or negative value on error
    */
-  void RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes);
+  float GetDefaultZoomFactor() const;
 
   /**
-   * @brief Set default zoom factor
+   * @brief Register url schemes as CORS enabled
+   *
+   * @param[in] schemes The URL schemes list which will be added to web security policy
    *
-   * @param[in] zoomFactor default zoom factor
    */
-  void SetDefaultZoomFactor(float zoomFactor);
+  void RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes);
 
   /**
-   * @brief Get default zoom factor
-   *
-   * Gets default zoom factor for all pages opened with this context.
+   * @brief Register JS plugin mime types.
    *
-   * @return @c default zoom factor or negative value on error
+   * @param[in] mimeTypes The MIME types will be checked by the renderer frame loader
+   * to skip creating default frame for the object tags with the registered MIME type.
    */
-  float GetContextDefaultZoomFactor() const;
+  void RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes);
 
   /**
    * @brief Request for deleting all web application caches.
@@ -323,28 +345,6 @@ public:
   void DeleteAllFormCandidateData();
 
   /**
-   * @brief Get the proxy URI from the network backend of specific context.
-   *
-   * @return current proxy URI or @c null string if it's not set
-   */
-  std::string GetContextProxy() const;
-
-  /**
-   * @brief Set the given proxy to network backend of specific context.
-   *
-   * @param[in] proxy URI to set
-   * @param[in] bypass rule to set
-   */
-  void SetContextProxy(const std::string& proxy, const std::string& bypass);
-
-  /**
-   * @brief Get the proxy bypass rule from the network backend of specific context.
-   *
-   * @return current proxy bypass rule or @c null string if it's not set
-   */
-  std::string GetProxyBypassRule() const;
-
-  /**
    * @brief Notify low memory to free unused memory.
    *
    * @return @c true on success or @c false otherwise.
index 5cac9f4..adeb66f 100755 (executable)
@@ -379,14 +379,14 @@ WebView::WebViewHttpAuthHandlerSignalType& WebView::HttpAuthHandlerSignal()
   return Dali::Toolkit::GetImpl(*this).HttpAuthHandlerSignal();
 }
 
-WebView::WebViewContextMenuCustomizedSignalType& WebView::ContextMenuCustomizedSignal()
+WebView::WebViewContextMenuShownSignalType& WebView::ContextMenuShownSignal()
 {
-  return Dali::Toolkit::GetImpl(*this).ContextMenuCustomizedSignal();
+  return Dali::Toolkit::GetImpl(*this).ContextMenuShownSignal();
 }
 
-WebView::WebViewContextMenuItemSelectedSignalType& WebView::ContextMenuItemSelectedSignal()
+WebView::WebViewContextMenuHiddenSignalType& WebView::ContextMenuHiddenSignal()
 {
-  return Dali::Toolkit::GetImpl(*this).ContextMenuItemSelectedSignal();
+  return Dali::Toolkit::GetImpl(*this).ContextMenuHiddenSignal();
 }
 
 WebView::WebView(Internal::WebView& implementation)
index b290bfd..8fb08b1 100755 (executable)
@@ -34,7 +34,6 @@ class ImageView;
 class WebBackForwardList;
 class WebContext;
 class WebContextMenu;
-class WebContextMenuItem;
 class WebCookieManager;
 class WebFormRepostDecision;
 class WebSettings;
@@ -249,14 +248,14 @@ public:
   using WebViewHttpAuthHandlerSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineHttpAuthHandler>)>;
 
   /**
-   * @brief WebView signal type related with context menu customized.
+   * @brief WebView signal type related with context menu shown.
    */
-  using WebViewContextMenuCustomizedSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineContextMenu>)>;
+  using WebViewContextMenuShownSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineContextMenu>)>;
 
   /**
-   * @brief WebView signal type related with context menu item selected.
+   * @brief WebView signal type related with context menu hidden.
    */
-  using WebViewContextMenuItemSelectedSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineContextMenuItem>)>;
+  using WebViewContextMenuHiddenSignalType = Signal<void(WebView, std::shared_ptr<Dali::WebEngineContextMenu>)>;
 
 public:
   /**
@@ -781,18 +780,18 @@ public:
   WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
 
   /**
-   * @brief Connect to this signal to be notified when context menu would be customized.
+   * @brief Connect to this signal to be notified when context menu would be shown.
    *
    * @return A signal object to connect with.
    */
-  WebViewContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+  WebViewContextMenuShownSignalType& ContextMenuShownSignal();
 
   /**
-   * @brief Connect to this signal to be notified when context menu item is selected.
+   * @brief Connect to this signal to be notified when context menu would be hidden.
    *
    * @return A signal object to connect with.
    */
-  WebViewContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+  WebViewContextMenuHiddenSignalType& ContextMenuHiddenSignal();
 
 public: // Not intended for application developers
   /// @cond internal
index 4a0219d..54e9026 100644 (file)
@@ -87,28 +87,26 @@ DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "pageZoomFactor",          FLOAT,
 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "textZoomFactor",          FLOAT,   TEXT_ZOOM_FACTOR          )
 DALI_PROPERTY_REGISTRATION(Toolkit, WebView, "loadProgressPercentage",  FLOAT,   LOAD_PROGRESS_PERCENTAGE  )
 
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted",         PAGE_LOAD_STARTED_SIGNAL         )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress",      PAGE_LOAD_IN_PROGRESS_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_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_SIGNAL_REGISTRATION(Toolkit, WebView, "requestInterceptor",      REQUEST_INTERCEPTOR_SIGNAL       )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "consoleMessage",          CONSOLE_MESSAGE_SIGNAL           )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "responsePolicyDecided",   POLICY_DECISION                  )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "certificateConfirm",      CERTIFICATE_CONFIRM_SIGNAL       )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "sslCertificateChanged",   SSL_CERTIFICATE_CHANGED_SIGNAL   )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "httpAuthRequest",         HTTP_AUTH_REQUEST_SIGNAL         )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "contextMenuCustomized",   CONTEXT_MENU_CUSTOMIZED_SIGNAL   )
-DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "contextMenuItemSelected", CONTEXT_MENU_ITEM_SELECTED_SIGNAL)
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadStarted",       PAGE_LOAD_STARTED_SIGNAL      )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "pageLoadInProgress",    PAGE_LOAD_IN_PROGRESS_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_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_SIGNAL_REGISTRATION(Toolkit, WebView, "requestInterceptor",    REQUEST_INTERCEPTOR_SIGNAL    )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "consoleMessage",        CONSOLE_MESSAGE_SIGNAL        )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "responsePolicyDecided", POLICY_DECISION               )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "certificateConfirm",    CERTIFICATE_CONFIRM_SIGNAL    )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "sslCertificateChanged", SSL_CERTIFICATE_CHANGED_SIGNAL)
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "httpAuthRequest",       HTTP_AUTH_REQUEST_SIGNAL      )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "contextMenuShown",      CONTEXT_MENU_SHOWN_SIGNAL     )
+DALI_SIGNAL_REGISTRATION(Toolkit, WebView, "contextMenuHidden",     CONTEXT_MENU_HIDDEN_SIGNAL    )
 
 DALI_TYPE_REGISTRATION_END()
 // clang-format on
 
-const std::string kEmptyString;
-
 } // namespace
 
 #define GET_ENUM_STRING(structName, inputExp) \
@@ -119,7 +117,6 @@ const std::string kEmptyString;
 
 WebView::WebView(const std::string& locale, const std::string& timezoneId)
 : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
-  mUrl(),
   mVisual(),
   mWebViewSize(Stage::GetCurrent().GetSize()),
   mWebEngine(),
@@ -144,7 +141,6 @@ WebView::WebView(const std::string& locale, const std::string& timezoneId)
 
 WebView::WebView(uint32_t argc, char** argv)
 : Control(ControlBehaviour(ACTOR_BEHAVIOUR_DEFAULT | DISABLE_STYLE_CHANGE_SIGNALS)),
-  mUrl(),
   mVisual(),
   mWebViewSize(Stage::GetCurrent().GetSize()),
   mWebEngine(),
@@ -240,8 +236,8 @@ void WebView::OnInitialize()
     mWebEngine.CertificateConfirmSignal().Connect(this, &WebView::OnCertificateConfirm);
     mWebEngine.SslCertificateChangedSignal().Connect(this, &WebView::OnSslCertificateChanged);
     mWebEngine.HttpAuthHandlerSignal().Connect(this, &WebView::OnHttpAuthenticationRequest);
-    mWebEngine.ContextMenuCustomizedSignal().Connect(this, &WebView::OnContextMenuCustomized);
-    mWebEngine.ContextMenuItemSelectedSignal().Connect(this, &WebView::OnContextMenuItemSelected);
+    mWebEngine.ContextMenuShownSignal().Connect(this, &WebView::OnContextMenuShown);
+    mWebEngine.ContextMenuHiddenSignal().Connect(this, &WebView::OnContextMenuHidden);
 
     mWebContext         = std::unique_ptr<Dali::Toolkit::WebContext>(new WebContext(mWebEngine.GetContext()));
     mWebCookieManager   = std::unique_ptr<Dali::Toolkit::WebCookieManager>(new WebCookieManager(mWebEngine.GetCookieManager()));
@@ -283,7 +279,6 @@ Dali::Toolkit::ImageView WebView::GetFavicon() const
 
 void WebView::LoadUrl(const std::string& url)
 {
-  mUrl = url;
   if(mWebEngine)
   {
     if(!mVisual)
@@ -747,14 +742,14 @@ Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& WebView::HttpAuthHandl
   return mHttpAuthHandlerSignal;
 }
 
-Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType& WebView::ContextMenuCustomizedSignal()
+Dali::Toolkit::WebView::WebViewContextMenuShownSignalType& WebView::ContextMenuShownSignal()
 {
-  return mContextMenuCustomizedSignal;
+  return mContextMenuShownSignal;
 }
 
-Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType& WebView::ContextMenuItemSelectedSignal()
+Dali::Toolkit::WebView::WebViewContextMenuHiddenSignalType& WebView::ContextMenuHiddenSignal()
 {
-  return mContextMenuItemSelectedSignal;
+  return mContextMenuHiddenSignal;
 }
 
 void WebView::OnPageLoadStarted(const std::string& url)
@@ -915,21 +910,21 @@ void WebView::OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAut
   }
 }
 
-void WebView::OnContextMenuCustomized(std::shared_ptr<Dali::WebEngineContextMenu> menu)
+void WebView::OnContextMenuShown(std::shared_ptr<Dali::WebEngineContextMenu> menu)
 {
-  if(!mContextMenuCustomizedSignal.Empty())
+  if(!mContextMenuShownSignal.Empty())
   {
     Dali::Toolkit::WebView handle(GetOwner());
-    mContextMenuCustomizedSignal.Emit(handle, std::move(menu));
+    mContextMenuShownSignal.Emit(handle, std::move(menu));
   }
 }
 
-void WebView::OnContextMenuItemSelected(std::shared_ptr<Dali::WebEngineContextMenuItem> item)
+void WebView::OnContextMenuHidden(std::shared_ptr<Dali::WebEngineContextMenu> menu)
 {
-  if(!mContextMenuItemSelectedSignal.Empty())
+  if(!mContextMenuHiddenSignal.Empty())
   {
     Dali::Toolkit::WebView handle(GetOwner());
-    mContextMenuItemSelectedSignal.Emit(handle, std::move(item));
+    mContextMenuHiddenSignal.Emit(handle, std::move(menu));
   }
 }
 
@@ -1010,14 +1005,14 @@ bool WebView::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tr
     webView.HttpAuthHandlerSignal().Connect(tracker, functor);
     connected = true;
   }
-  else if(0 == strcmp(signalName.c_str(), CONTEXT_MENU_CUSTOMIZED_SIGNAL))
+  else if(0 == strcmp(signalName.c_str(), CONTEXT_MENU_SHOWN_SIGNAL))
   {
-    webView.ContextMenuCustomizedSignal().Connect(tracker, functor);
+    webView.ContextMenuShownSignal().Connect(tracker, functor);
     connected = true;
   }
-  else if(0 == strcmp(signalName.c_str(), CONTEXT_MENU_ITEM_SELECTED_SIGNAL))
+  else if(0 == strcmp(signalName.c_str(), CONTEXT_MENU_HIDDEN_SIGNAL))
   {
-    webView.ContextMenuItemSelectedSignal().Connect(tracker, functor);
+    webView.ContextMenuHiddenSignal().Connect(tracker, functor);
     connected = true;
   }
 
@@ -1179,7 +1174,7 @@ Property::Value WebView::GetProperty(BaseObject* object, Property::Index propert
     {
       case Toolkit::WebView::Property::URL:
       {
-        value = impl.mUrl;
+        value = impl.GetUrl();
         break;
       }
       case Toolkit::WebView::Property::USER_AGENT:
@@ -1337,7 +1332,7 @@ Dali::Vector2 WebView::GetContentSize() const
 
 std::string WebView::GetTitle() const
 {
-  return mWebEngine ? mWebEngine.GetTitle() : kEmptyString;
+  return mWebEngine ? mWebEngine.GetTitle() : std::string();
 }
 
 void WebView::SetDocumentBackgroundColor(Dali::Vector4 color)
@@ -1374,12 +1369,17 @@ void WebView::EnableCursorByClient(bool enabled)
 
 std::string WebView::GetSelectedText() const
 {
-  return mWebEngine ? mWebEngine.GetSelectedText() : kEmptyString;
+  return mWebEngine ? mWebEngine.GetSelectedText() : std::string();
+}
+
+std::string WebView::GetUrl() const
+{
+  return mWebEngine ? mWebEngine.GetUrl() : std::string();
 }
 
-const std::string& WebView::GetUserAgent() const
+std::string WebView::GetUserAgent() const
 {
-  return mWebEngine ? mWebEngine.GetUserAgent() : kEmptyString;
+  return mWebEngine ? mWebEngine.GetUserAgent() : std::string();
 }
 
 void WebView::SetUserAgent(const std::string& userAgent)
index 8cc532f..bbe7b27 100755 (executable)
@@ -378,14 +378,14 @@ public:
   Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType& HttpAuthHandlerSignal();
 
   /**
-   * @copydoc Dali::Toolkit::WebView::ContextMenuCustomizedSignal()
+   * @copydoc Dali::Toolkit::WebView::ContextMenuShownSignal()
    */
-  Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType& ContextMenuCustomizedSignal();
+  Dali::Toolkit::WebView::WebViewContextMenuShownSignalType& ContextMenuShownSignal();
 
   /**
-   * @copydoc Dali::Toolkit::WebView::ContextMenuItemSelectedSignal()
+   * @copydoc Dali::Toolkit::WebView::ContextMenuHiddenSignal()
    */
-  Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType& ContextMenuItemSelectedSignal();
+  Dali::Toolkit::WebView::WebViewContextMenuHiddenSignalType& ContextMenuHiddenSignal();
 
 public: // Properties
   /**
@@ -522,10 +522,16 @@ private:
   std::string GetSelectedText() const;
 
   /**
+   * @brief Get url of web page.
+   * @return The string of url
+   */
+  std::string GetUrl() const;
+
+  /**
    * @brief Get user agent string.
    * @return The string value of user agent
    */
-  const std::string& GetUserAgent() const;
+  std::string GetUserAgent() const;
 
   /**
    * @brief Set user agent string.
@@ -738,39 +744,38 @@ private:
   void OnHttpAuthenticationRequest(std::shared_ptr<Dali::WebEngineHttpAuthHandler> handler);
 
   /**
-   * @brief Callback function to be called when context menu would be customized.
+   * @brief Callback function to be called when context menu would be shown.
    * @param[in] e The scroll edge reached.
    */
-  void OnContextMenuCustomized(std::shared_ptr<Dali::WebEngineContextMenu> menu);
+  void OnContextMenuShown(std::shared_ptr<Dali::WebEngineContextMenu> menu);
 
   /**
-   * @brief Callback function to be called when context menu item is selected.
+   * @brief Callback function to be called when context menu would be hidden.
    * @param[in] url The url currently being loaded
    */
-  void OnContextMenuItemSelected(std::shared_ptr<Dali::WebEngineContextMenuItem> item);
+  void OnContextMenuHidden(std::shared_ptr<Dali::WebEngineContextMenu> menu);
 
 private:
-  std::string                 mUrl;
   Dali::Toolkit::Visual::Base mVisual;
   Dali::Size                  mWebViewSize;
   Dali::WebEngine             mWebEngine;
 
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadStartedSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadInProgressSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadSignalType                mPageLoadFinishedSignal;
-  Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType           mPageLoadErrorSignal;
-  Dali::Toolkit::WebView::WebViewUrlChangedSignalType              mUrlChangedSignal;
-  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType       mScrollEdgeReachedSignal;
-  Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType      mFormRepostDecisionSignal;
-  Dali::Toolkit::WebView::WebViewFrameRenderedSignalType           mFrameRenderedSignal;
-  Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType      mRequestInterceptorSignal;
-  Dali::Toolkit::WebView::WebViewConsoleMessageSignalType          mConsoleMessageSignal;
-  Dali::Toolkit::WebView::WebViewResponsePolicyDecisionSignalType  mResponsePolicyDecisionSignal;
-  Dali::Toolkit::WebView::WebViewCertificateSignalType             mCertificateConfirmSignal;
-  Dali::Toolkit::WebView::WebViewCertificateSignalType             mSslCertificateChangedSignal;
-  Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType         mHttpAuthHandlerSignal;
-  Dali::Toolkit::WebView::WebViewContextMenuCustomizedSignalType   mContextMenuCustomizedSignal;
-  Dali::Toolkit::WebView::WebViewContextMenuItemSelectedSignalType mContextMenuItemSelectedSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType               mPageLoadStartedSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType               mPageLoadInProgressSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadSignalType               mPageLoadFinishedSignal;
+  Dali::Toolkit::WebView::WebViewPageLoadErrorSignalType          mPageLoadErrorSignal;
+  Dali::Toolkit::WebView::WebViewUrlChangedSignalType             mUrlChangedSignal;
+  Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType      mScrollEdgeReachedSignal;
+  Dali::Toolkit::WebView::WebViewFormRepostDecisionSignalType     mFormRepostDecisionSignal;
+  Dali::Toolkit::WebView::WebViewFrameRenderedSignalType          mFrameRenderedSignal;
+  Dali::Toolkit::WebView::WebViewRequestInterceptorSignalType     mRequestInterceptorSignal;
+  Dali::Toolkit::WebView::WebViewConsoleMessageSignalType         mConsoleMessageSignal;
+  Dali::Toolkit::WebView::WebViewResponsePolicyDecisionSignalType mResponsePolicyDecisionSignal;
+  Dali::Toolkit::WebView::WebViewCertificateSignalType            mCertificateConfirmSignal;
+  Dali::Toolkit::WebView::WebViewCertificateSignalType            mSslCertificateChangedSignal;
+  Dali::Toolkit::WebView::WebViewHttpAuthHandlerSignalType        mHttpAuthHandlerSignal;
+  Dali::Toolkit::WebView::WebViewContextMenuShownSignalType       mContextMenuShownSignal;
+  Dali::Toolkit::WebView::WebViewContextMenuHiddenSignalType      mContextMenuHiddenSignal;
 
   std::unique_ptr<Dali::Toolkit::WebContext>         mWebContext;
   std::unique_ptr<Dali::Toolkit::WebCookieManager>   mWebCookieManager;