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 for cache model options.
24 /// <since_tizen> 4 </since_tizen>
25 public enum CacheModel
28 /// Use the smallest cache capacity.
32 /// Use the bigger cache capacity than DocumentBrowser.
36 /// Use the biggest cache capacity.
42 /// This class encapsulates all the pages related to the specific use of the Chromium-efl.
45 /// Applications have the option of creating a context different from the default one and using it for a group of pages.
46 /// All pages in the same context share the same preferences, visited link set, local storage, and so on.
48 /// <since_tizen> 4 </since_tizen>
51 private IntPtr _handle;
52 private CookieManager _cookieManager;
54 internal Context(IntPtr handle)
63 /// The default cache model is DocumentViewer.
65 /// <since_tizen> 4 </since_tizen>
66 public CacheModel CacheModel
70 return (CacheModel)Interop.ChromiumEwk.ewk_context_cache_model_get(_handle);
75 Interop.ChromiumEwk.ewk_context_cache_model_set(_handle, (Interop.ChromiumEwk.CacheModel)value);
80 /// Gets the CookieManager object for this context.
82 /// <returns>The CookieManager object.</returns>
83 /// <since_tizen> 4 </since_tizen>
84 public CookieManager GetCookieManager()
86 if (_cookieManager == null)
88 IntPtr cookieManagerHandle = Interop.ChromiumEwk.ewk_context_cookie_manager_get(_handle);
89 if (cookieManagerHandle == IntPtr.Zero)
93 _cookieManager = new CookieManager(cookieManagerHandle);
95 return _cookieManager;