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
27 /// Use the smallest cache capacity.
31 /// Use bigger cache capacity than DocumentBrowser.
35 /// Use the biggest cache capacity.
41 /// This class encapsulates all pages related to the specific use of Chromium-efl.
44 /// Applications have the option of creating a context different from the default one and using it for a group of pages.
45 /// All pages in the same context share the same preferences, visited link set, local storage, and so on.
49 private IntPtr _handle;
50 private CookieManager _cookieManager;
52 internal Context(IntPtr handle)
61 /// The default cache model is DocumentViewer.
63 public CacheModel CacheModel
67 return (CacheModel)Interop.ChromiumEwk.ewk_context_cache_model_get(_handle);
72 Interop.ChromiumEwk.ewk_context_cache_model_set(_handle, (Interop.ChromiumEwk.CacheModel)value);
77 /// Gets the CookieManager object for this context.
79 /// <returns>The CookieManager object</returns>
80 public CookieManager GetCookieManager()
82 if (_cookieManager == null)
84 IntPtr cookieManagerHandle = Interop.ChromiumEwk.ewk_context_cookie_manager_get(_handle);
85 if (cookieManagerHandle == IntPtr.Zero)
89 _cookieManager = new CookieManager(cookieManagerHandle);
91 return _cookieManager;