bool OnFormPasswordAcquired();
bool OnDownloadStarted();
bool OnMimeOverridden();
+bool OnChangesWatch();
static void ConnectToGlobalSignal( bool ( *func )() )
{
{
}
+ void ChangesWatch( Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback callback ) override
+ {
+ if ( callback )
+ {
+ ConnectToGlobalSignal( &OnChangesWatch );
+ mChangesWatchCallback = callback;
+ }
+ }
+
+public:
+ Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback mChangesWatchCallback;
+
private:
Dali::WebEngineCookieManager::CookieAcceptPolicy mockCookieAcceptPolicy;
};
return false;
}
+bool OnChangesWatch()
+{
+ DisconnectFromGlobalSignal( &OnChangesWatch );
+
+ if ( gInstance )
+ {
+ MockWebEngineCookieManager* temp = (MockWebEngineCookieManager *)(&(gInstance->GetCookieManager()));
+ if ( temp )
+ {
+ temp->mChangesWatchCallback();
+ }
+ }
+
+ return false;
+}
+
} // namespace
inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
static int gContextMenuItemSelectedCallbackCalled = 0;
static std::shared_ptr<Dali::WebEngineContextMenuItem> gContextMenuItemInstance = nullptr;
static int gHitTestCreatedCallbackCalled = 0;
+static int gCookieManagerChangsWatchCallbackCalled = 0;
struct CallbackFunctor
{
return true;
}
+static void OnChangesWatch()
+{
+ gCookieManagerChangsWatchCallbackCalled++;
+}
+
static bool OnHovered( Actor actor, const Dali::HoverEvent& hover )
{
gHovered = true;
END_TEST;
}
+int UtcDaliWebCookieManagerChangesWatch(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ DALI_TEST_CHECK( view );
+
+ Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
+ DALI_TEST_CHECK( cookieManager != 0 )
+
+ cookieManager->ChangesWatch(&OnChangesWatch);
+ Test::EmitGlobalTimerSignal();
+ DALI_TEST_EQUALS( gCookieManagerChangsWatchCallbackCalled, 1, TEST_LOCATION );
+
+ END_TEST;
+}
+
// test cases for web settings.
int UtcDaliWebSettingsGetSetDefaultFontSize(void)
mWebEngineCookieManager.SetPersistentStorage(path, storage);
}
+void WebCookieManager::ChangesWatch(Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback callback)
+{
+ mWebEngineCookieManager.ChangesWatch(callback);
+}
+
} // namespace Toolkit
} // namespace Dali
*/
void SetPersistentStorage(const std::string& path, Dali::WebEngineCookieManager::CookiePersistentStorage storage);
+ /**
+ * @brief Watch for cookies' changes in @a manager.
+ *
+ * @param[in] callback cookies are added, removed or modified.
+ */
+ void ChangesWatch(Dali::WebEngineCookieManager::WebEngineCookieManagerChangesWatchCallback callback);
+
private:
Dali::WebEngineCookieManager& mWebEngineCookieManager;
};