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 std::string WebContext::GetProxyUri() const
54 return mWebEngineContext.GetProxyUri();
57 void WebContext::SetProxyBypassRule(const std::string& proxy, const std::string& bypass)
59 mWebEngineContext.SetProxyBypassRule(proxy, bypass);
62 std::string WebContext::GetProxyBypassRule() const
64 return mWebEngineContext.GetProxyBypassRule();
67 void WebContext::SetCertificateFilePath(const std::string& certificatePath)
69 mWebEngineContext.SetCertificateFilePath(certificatePath);
72 std::string WebContext::GetCertificateFilePath() const
74 return mWebEngineContext.GetCertificateFilePath();
77 void WebContext::SetDefaultProxyAuth(const std::string& username, const std::string& password)
79 mWebEngineContext.SetDefaultProxyAuth(username, password);
82 void WebContext::DeleteAllWebDatabase()
84 mWebEngineContext.DeleteAllWebDatabase();
87 bool WebContext::GetWebDatabaseOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
89 return mWebEngineContext.GetWebDatabaseOrigins(callback);
92 bool WebContext::DeleteWebDatabase(Dali::WebEngineSecurityOrigin& origin)
94 return mWebEngineContext.DeleteWebDatabase(origin);
97 bool WebContext::GetWebStorageOrigins(Dali::WebEngineContext::WebEngineSecurityOriginAcquiredCallback callback)
99 return mWebEngineContext.GetWebStorageOrigins(callback);
102 bool WebContext::GetWebStorageUsageForOrigin(Dali::WebEngineSecurityOrigin& origin, Dali::WebEngineContext::WebEngineStorageUsageAcquiredCallback callback)
104 return mWebEngineContext.GetWebStorageUsageForOrigin(origin, callback);
107 void WebContext::DeleteAllWebStorage()
109 mWebEngineContext.DeleteAllWebStorage();
112 bool WebContext::DeleteWebStorage(Dali::WebEngineSecurityOrigin& origin)
114 return mWebEngineContext.DeleteWebStorage(origin);
117 void WebContext::DeleteLocalFileSystem()
119 mWebEngineContext.DeleteLocalFileSystem();
122 void WebContext::ClearCache()
124 mWebEngineContext.ClearCache();
127 bool WebContext::DeleteApplicationCache(Dali::WebEngineSecurityOrigin& origin)
129 return mWebEngineContext.DeleteApplicationCache(origin);
132 void WebContext::GetFormPasswordList(Dali::WebEngineContext::WebEngineFormPasswordAcquiredCallback callback)
134 mWebEngineContext.GetFormPasswordList(callback);
137 void WebContext::RegisterDownloadStartedCallback(Dali::WebEngineContext::WebEngineDownloadStartedCallback callback)
139 mWebEngineContext.RegisterDownloadStartedCallback(callback);
142 void WebContext::RegisterMimeOverriddenCallback(Dali::WebEngineContext::WebEngineMimeOverriddenCallback callback)
144 mWebEngineContext.RegisterMimeOverriddenCallback(callback);
147 void WebContext::RegisterRequestInterceptedCallback(Dali::WebEngineContext::WebEngineRequestInterceptedCallback callback)
149 mWebEngineContext.RegisterRequestInterceptedCallback(callback);
152 void WebContext::EnableCache(bool cacheEnabled)
154 mWebEngineContext.EnableCache(cacheEnabled);
157 bool WebContext::IsCacheEnabled() const
159 return mWebEngineContext.IsCacheEnabled();
162 void WebContext::SetAppId(const std::string& appId)
164 mWebEngineContext.SetAppId(appId);
167 bool WebContext::SetAppVersion(const std::string& appVersion)
169 return mWebEngineContext.SetAppVersion(appVersion);
172 void WebContext::SetApplicationType(const Dali::WebEngineContext::ApplicationType applicationType)
174 mWebEngineContext.SetApplicationType(applicationType);
177 void WebContext::SetTimeOffset(float timeOffset)
179 mWebEngineContext.SetTimeOffset(timeOffset);
182 void WebContext::SetTimeZoneOffset(float timeZoneOffset, float daylightSavingTime)
184 mWebEngineContext.SetTimeZoneOffset(timeZoneOffset, daylightSavingTime);
187 void WebContext::SetDefaultZoomFactor(float zoomFactor)
189 mWebEngineContext.SetDefaultZoomFactor(zoomFactor);
192 float WebContext::GetDefaultZoomFactor() const
194 return mWebEngineContext.GetDefaultZoomFactor();
197 void WebContext::RegisterUrlSchemesAsCorsEnabled(const std::vector<std::string>& schemes)
199 mWebEngineContext.RegisterUrlSchemesAsCorsEnabled(schemes);
202 void WebContext::RegisterJsPluginMimeTypes(const std::vector<std::string>& mimeTypes)
204 mWebEngineContext.RegisterJsPluginMimeTypes(mimeTypes);
207 bool WebContext::DeleteAllApplicationCache()
209 return mWebEngineContext.DeleteAllApplicationCache();
212 bool WebContext::DeleteAllWebIndexedDatabase()
214 return mWebEngineContext.DeleteAllWebIndexedDatabase();
217 void WebContext::DeleteFormPasswordDataList(const std::vector<std::string>& list)
219 mWebEngineContext.DeleteFormPasswordDataList(list);
222 void WebContext::DeleteAllFormPasswordData()
224 mWebEngineContext.DeleteAllFormPasswordData();
227 void WebContext::DeleteAllFormCandidateData()
229 mWebEngineContext.DeleteAllFormCandidateData();
232 bool WebContext::FreeUnusedMemory()
234 return mWebEngineContext.FreeUnusedMemory();
237 } // namespace Toolkit