2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
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.
18 namespace Tizen.WebView
21 /// Enumeration that contains accept policies for the cookies.
23 public enum CookieAcceptPolicy
26 /// Accepts every cookie sent from any page.
30 /// Rejects all cookies.
34 /// Accepts only cookies set by the main document loaded.
40 /// Enumeration that creates a type name for the storage of persistent cookies.
42 public enum CookiePersistentStorage
45 /// Cookies are stored in a text file in the Mozilla "cookies.txt" format.
49 /// Cookies are stored in a SQLite file in the current Mozilla format.
55 /// This class provides methods for the cookie manager.
57 public class CookieManager
59 private IntPtr _handle;
61 internal CookieManager(IntPtr handle)
67 /// Sets the cookie acceptance policy.
70 /// By default, only cookies set by the main document loaded are accepted.
72 /// <param name="policy">The cookie acceptance policy</param>
73 public void SetCookieAcceptPolicy(CookieAcceptPolicy policy)
75 Interop.ChromiumEwk.ewk_cookie_manager_accept_policy_set(_handle, (Interop.ChromiumEwk.CookieAcceptPolicy)policy);
79 /// Deletes all the cookies.
81 public void ClearCookies()
83 Interop.ChromiumEwk.ewk_cookie_manager_cookies_clear(_handle);
87 /// Sets the storage where non-session cookies are stored persistently to read/write the cookies.
89 /// <privilege>http://tizen.org/privilege/mediastorage</privilege>
90 /// <privilege>http://tizen.org/privilege/externalstorage</privilege>
91 /// <param name="path">The path where to read/write Cookies</param>
92 /// <param name="storage">The type of storage</param>
93 public void SetPersistentStorage(string path, CookiePersistentStorage storage)
95 Interop.ChromiumEwk.ewk_cookie_manager_persistent_storage_set(_handle, path, (Interop.ChromiumEwk.CookiePersistentStorage)storage);