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.
19 namespace Tizen.WebView
22 /// Enumeration that contains option for cache model.
24 public enum CacheModel
26 DocumentViewer, /* Use the smallest cache capacity */
27 DocumentBrowser, /* Use bigger cache capacity than DocumentBrowser */
28 PrimaryWebBrowser /* Use the biggest cache capacity. */
33 private IntPtr _handle;
34 private CookieManager _cookieManager;
36 internal Context(IntPtr handle)
45 /// The default cache model is DocumentViewer.
47 public CacheModel CacheModel
51 return (CacheModel)Interop.ChromiumEwk.ewk_context_cache_model_get(_handle);
56 Interop.ChromiumEwk.ewk_context_cache_model_set(_handle, (Interop.ChromiumEwk.CacheModel)value);
61 /// Gets the CookieManager object for this context.
63 /// <returns>The CookieManager object</returns>
64 public CookieManager GetCookieManager()
66 if (_cookieManager == null)
68 IntPtr cookieManagerHandle = Interop.ChromiumEwk.ewk_context_cookie_manager_get(_handle);
69 if (cookieManagerHandle == IntPtr.Zero)
73 _cookieManager = new CookieManager(cookieManagerHandle);
75 return _cookieManager;