Beispiel #1
0
        internal unsafe cef_settings_t *CreateNative()
        {
            var ptr = cef_settings_t.Alloc();

            ptr->multi_threaded_message_loop = this.MultiThreadedMessageLoop;
            cef_string_t.Copy(this.CachePath, &ptr->cache_path);
            cef_string_t.Copy(this.UserAgent, &ptr->user_agent);
            cef_string_t.Copy(this.ProductVersion, &ptr->product_version);
            cef_string_t.Copy(this.Locale, &ptr->locale);
            ptr->extra_plugin_paths = CefStringList.CreateHandle(this.ExtraPluginPaths);
            cef_string_t.Copy(this.LogFile, &ptr->log_file);
            ptr->log_severity            = (cef_log_severity_t)this.LogSeverity;
            ptr->release_dcheck_enabled  = this.release_dcheck_enabled;
            ptr->graphics_implementation = (cef_graphics_implementation_t)this.GraphicsImplementation;
            ptr->local_storage_quota     = this.LocalStorageQuota;
            ptr->session_storage_quota   = this.SessionStorageQuota;
            cef_string_t.Copy(this.JavaScriptFlags, &ptr->javascript_flags);

#if WINDOWS
            ptr->auto_detect_proxy_settings_enabled = this.AutoDetectProxySettingsEnabled;
#endif

            cef_string_t.Copy(this.ResourcesDirPath, &ptr->resources_dir_path);
            cef_string_t.Copy(this.LocalesDirPath, &ptr->locales_dir_path);
            ptr->pack_loading_disabled         = this.PackLoadingDisabled;
            ptr->uncaught_exception_stack_size = this.uncaught_exception_stack_size;
            ptr->context_safety_implementation = this.context_safety_implementation;

            return(ptr);
        }
        public void Test1()
        {
            var list = new CefStringList();

            list.Add("String 1");
            list.Add("String 2");
            list.Add("String 3");

            Assert.That(list.Count, Is.EqualTo(3));

            Assert.That(list[0], Is.EqualTo("String 1"));
            Assert.That(list[1], Is.EqualTo("String 2"));
            Assert.That(list[2], Is.EqualTo("String 3"));

            var list2 = list.Clone();
            list.Clear();

            Assert.That(list.Count, Is.EqualTo(0));
            // TODO: list.Dispose();

            Assert.That(list2.Count, Is.EqualTo(3));
            Assert.That(list2[0], Is.EqualTo("String 1"));
            Assert.That(list2[1], Is.EqualTo("String 2"));
            Assert.That(list2[2], Is.EqualTo("String 3"));

            // TODO: list2.Dispose();
        }
Beispiel #3
0
        /// <summary>
        /// Called when the Favicon URL for a page changes.
        /// </summary>
        private void on_favicon_urlchange(cef_display_handler_t *self, cef_browser_t *browser, cef_string_list *icon_urls)
        {
            ThrowIfObjectDisposed();

            var m_browser   = CefBrowser.From(browser);
            var m_icon_urls = CefStringList.From(icon_urls);

            this.OnFaviconChange(m_browser, m_icon_urls);
        }
Beispiel #4
0
        /// <summary>
        /// Retrieve the list of file names that are being dragged into the
        /// browser window.
        /// </summary>
        public CefStringList GetFileNames()
        {
            var nList = CefStringList.CreateHandle();

            var success = cef_drag_data_t.invoke_get_file_names(this.ptr, nList) != 0;

            if (success)
            {
                return(CefStringList.From(nList, true));
            }
            else
            {
                CefStringList.DestroyHandle(nList);
                return(null);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Read the keys for the object's values into the specified vector.
        /// Integer- based keys will also be returned as strings.
        /// </summary>
        public bool TryGetKeys(out CefStringList keys)
        {
            ThrowIfObjectIsInvalid();
            var nList = CefStringList.CreateHandle();

            var success = cef_v8value_t.invoke_get_keys(this.ptr, nList) != 0;

            if (success)
            {
                keys = CefStringList.From(nList, true);
                return(true);
            }
            else
            {
                CefStringList.DestroyHandle(nList);
                keys = null;
                return(false);
            }
        }
        /// <summary>
        /// Read the keys for the object's values into the specified vector.
        /// Integer- based keys will also be returned as strings.
        /// </summary>
        public bool TryGetKeys(out CefStringList keys)
        {
            ThrowIfObjectIsInvalid();
            var nList = CefStringList.CreateHandle();

            var success = cef_v8value_t.invoke_get_keys(this.ptr, nList) != 0;

            if (success)
            {
                keys = CefStringList.From(nList, true);
                return true;
            }
            else
            {
                CefStringList.DestroyHandle(nList);
                keys = null;
                return false;
            }
        }
 /// <summary>
 /// Called when the Favicon URL for a page changes.
 /// </summary>
 protected virtual void OnFaviconChange(CefBrowser m_browser, CefStringList m_icon_urls)
 {
 }
 /// <summary>
 /// Returns the names of all existing frames.
 /// This method should only be called on the UI thread.
 /// </summary>
 public CefStringList GetFrameNames()
 {
     var result = new CefStringList();
     cef_browser_t.invoke_get_frame_names(this.ptr, result.Handle);
     return result;
 }
Beispiel #9
0
 /// <summary>
 /// Set the schemes supported by this manager. By default only "http" and
 /// "https" schemes are supported. Must be called before any cookies are
 /// accessed.
 /// </summary>
 public void SetSupportedSchemes(IEnumerable <string> schemes)
 {
     cef_cookie_manager_t.invoke_set_supported_schemes(this.ptr, CefStringList.CreateHandle(schemes));
 }
Beispiel #10
0
 /// <summary>
 /// Called when the Favicon URL for a page changes.
 /// </summary>
 protected virtual void OnFaviconChange(CefBrowser m_browser, CefStringList m_icon_urls)
 {
 }