2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/devel-api/controls/web-view/web-context.h>
22 #include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
28 WebContext::WebContext(Dali::WebEngineContext& context)
29 : mWebEngineContext(context)
33 WebContext::~WebContext()
37 Dali::WebEngineContext::CacheModel WebContext::GetCacheModel() const
39 return mWebEngineContext.GetCacheModel();
42 void WebContext::SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel)
44 mWebEngineContext.SetCacheModel(cacheModel);
47 void WebContext::SetProxyUri(const std::string& uri)
49 mWebEngineContext.SetProxyUri(uri);
52 void WebContext::SetCertificateFilePath(const std::string& certificatePath)
54 mWebEngineContext.SetCertificateFilePath(certificatePath);
57 void WebContext::SetDefaultProxyAuth(const std::string& username, const std::string& password)
59 mWebEngineContext.SetDefaultProxyAuth(username, password);
62 void WebContext::DeleteAllWebDatabase()
64 mWebEngineContext.DeleteAllWebDatabase();
67 bool WebContext::GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
69 return mWebEngineContext.GetWebDatabaseOrigins(callback);
72 bool WebContext::DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
74 return mWebEngineContext.DeleteWebDatabase(origin);
77 bool WebContext::GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
79 return mWebEngineContext.GetWebStorageOrigins(callback);
82 bool WebContext::GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback)
84 return mWebEngineContext.GetWebStorageUsageForOrigin(origin, callback);
87 void WebContext::DeleteAllWebStorage()
89 mWebEngineContext.DeleteAllWebStorage();
92 bool WebContext::DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin)
94 return mWebEngineContext.DeleteWebStorage(origin);
97 void WebContext::DeleteLocalFileSystem()
99 mWebEngineContext.DeleteLocalFileSystem();
102 void WebContext::ClearCache()
104 mWebEngineContext.ClearCache();
107 bool WebContext::DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
109 return mWebEngineContext.DeleteApplicationCache(origin);
112 void WebContext::GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
114 mWebEngineContext.GetFormPasswordList(callback);
117 void WebContext::RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
119 mWebEngineContext.RegisterDownloadStartedCallback(callback);
122 void WebContext::RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
124 mWebEngineContext.RegisterMimeOverriddenCallback(callback);
127 void WebContext::EnableCache(bool cacheEnabled)
129 mWebEngineContext.EnableCache(cacheEnabled);
132 bool WebContext::IsCacheEnabled() const
134 return mWebEngineContext.IsCacheEnabled();
137 std::string WebContext::GetContextCertificateFile() const
139 return mWebEngineContext.GetContextCertificateFile();
142 void WebContext::SetContextAppId(const std::string& appID)
144 mWebEngineContext.SetContextAppId(appID);
147 bool WebContext::SetContextAppVersion(const std::string& appVersion)
149 return mWebEngineContext.SetContextAppVersion(appVersion);
152 void WebContext::SetContextApplicationType(const Dali::WebEngineContext::ApplicationType applicationType)
154 mWebEngineContext.SetContextApplicationType(applicationType);
157 void WebContext::SetContextTimeOffset(float timeOffset)
159 mWebEngineContext.SetContextTimeOffset(timeOffset);
162 void WebContext::SetContextTimeZoneOffset(float timeZoneOffset, float daylightSavingTime)
164 mWebEngineContext.SetContextTimeZoneOffset(timeZoneOffset, daylightSavingTime);
167 void WebContext::RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes)
169 mWebEngineContext.RegisterUrlSchemesAsCorsEnabled(schemes);
172 void WebContext::RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes)
174 mWebEngineContext.RegisterJsPluginMimeTypes(mimeTypes);
177 void WebContext::SetDefaultZoomFactor(float zoomFactor)
179 mWebEngineContext.SetDefaultZoomFactor(zoomFactor);
182 float WebContext::GetContextDefaultZoomFactor() const
184 return mWebEngineContext.GetContextDefaultZoomFactor();
187 bool WebContext::DeleteAllApplicationCache()
189 return mWebEngineContext.DeleteAllApplicationCache();
192 bool WebContext::DeleteAllWebIndexedDatabase()
194 return mWebEngineContext.DeleteAllWebIndexedDatabase();
197 void WebContext::DeleteFormPasswordDataList(const std::vector<std::string>& list)
199 mWebEngineContext.DeleteFormPasswordDataList(list);
202 void WebContext::DeleteAllFormPasswordData()
204 mWebEngineContext.DeleteAllFormPasswordData();
207 void WebContext::DeleteAllFormCandidateData()
209 mWebEngineContext.DeleteAllFormCandidateData();
212 std::string WebContext::GetContextProxy() const
214 return mWebEngineContext.GetContextProxy();
217 void WebContext::SetContextProxy(const std::string& proxy, const std::string& bypass)
219 mWebEngineContext.SetContextProxy(proxy, bypass);
222 std::string WebContext::GetProxyBypassRule() const
224 return mWebEngineContext.GetProxyBypassRule();
227 bool WebContext::FreeUnusedMemory()
229 return mWebEngineContext.FreeUnusedMemory();
232 } // namespace Toolkit