예제 #1
0
 public CefStringListEnumerator(CefStringList list)
 {
     _index = 0;
     _list  = list;
     _cstr0 = new cef_string_t();
     _count = list.Count;
 }
예제 #2
0
        private static unsafe void OnResolveCompletedImpl(cef_resolve_callback_t *self, CefErrorCode result, cef_string_list_t resolved_ips)
        {
            var instance = GetInstance((IntPtr)self) as CefResolveCallback;

            if (instance == null || ((ICefResolveCallbackPrivate)instance).AvoidOnResolveCompleted())
            {
                return;
            }
            instance.OnResolveCompleted(result, CefStringList.Wrap(resolved_ips));
        }
예제 #3
0
        private static unsafe void GetCookieableSchemesImpl(cef_browser_process_handler_t *self, cef_string_list_t schemes, int *include_defaults)
        {
            var instance = GetInstance((IntPtr)self) as CefBrowserProcessHandler;

            if (instance == null || ((ICefBrowserProcessHandlerPrivate)instance).AvoidGetCookieableSchemes())
            {
                return;
            }
            instance.GetCookieableSchemes(CefStringList.Wrap(schemes), ref *include_defaults);
        }
예제 #4
0
        private static unsafe void OnFileDialogDismissedImpl(cef_run_file_dialog_callback_t *self, int selected_accept_filter, cef_string_list_t file_paths)
        {
            var instance = GetInstance((IntPtr)self) as CefRunFileDialogCallback;

            if (instance == null || ((ICefRunFileDialogCallbackPrivate)instance).AvoidOnFileDialogDismissed())
            {
                return;
            }
            instance.OnFileDialogDismissed(selected_accept_filter != 0, CefStringList.Wrap(file_paths));
        }
예제 #5
0
        // void (*)(_cef_display_handler_t* self, _cef_browser_t* browser, cef_string_list_t icon_urls)*
        private static unsafe void OnFaviconUrlChangeImpl(cef_display_handler_t *self, cef_browser_t *browser, cef_string_list_t icon_urls)
        {
            var instance = GetInstance((IntPtr)self) as CefDisplayHandler;

            if (instance == null || ((ICefDisplayHandlerPrivate)instance).AvoidOnFaviconUrlChange())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)browser);
                return;
            }
            instance.OnFaviconUrlChange(CefBrowser.Wrap(CefBrowser.Create, browser), CefStringList.Wrap(icon_urls));
        }
예제 #6
0
 /// <summary>
 /// Called when the page icon changes.
 /// </summary>
 protected internal unsafe virtual void OnFaviconUrlChange(CefBrowser browser, CefStringList iconUrls)
 {
 }
예제 #7
0
 /// <summary>
 /// Called on the browser process UI thread to retrieve the list of schemes
 /// that should support cookies.
 /// </summary>
 /// <param name="schemes">Providing an null value and setting <paramref name="includeDefaults"/> to false
 /// will disable all loading and saving of cookies.
 /// </param>
 /// <param name="includeDefaults">
 /// If true the default schemes (&quot;http&quot;, &quot;https&quot;, &quot;ws&quot; and &quot;wss&quot;)
 /// will also be supported.
 /// </param>
 /// <remarks>
 /// This state will apply to the <see cref="CefCookieManager"/> associated with the
 /// global <see cref="CefRequestContext"/>. It will also be used as the initial state for
 /// any new <see cref="CefRequestContext"/>&apos;s created by the client. After creating a new
 /// <see cref="CefRequestContext"/> the <see cref="CefCookieManager.SetSupportedSchemes"/>
 /// function may be called on the associated <see cref="CefCookieManager"/> to futher
 /// override these values.
 /// </remarks>
 protected internal virtual void GetCookieableSchemes(CefStringList schemes, ref int includeDefaults)
 {
 }
예제 #8
0
 /// <summary>
 /// Retrieve the list of all extensions that this context has access to (see
 /// HasExtension). |extension_ids| will be populated with the list of extension
 /// ID values. Returns true (1) on success. This function must be called on the
 /// browser process UI thread.
 /// </summary>
 public unsafe virtual bool GetExtensions(CefStringList extensionIds)
 {
     return(SafeCall(NativeInstance->GetExtensions(extensionIds.GetNativeInstance()) != 0));
 }
예제 #9
0
 /// <summary>
 /// Retrieve the list of domain components.
 /// </summary>
 public unsafe virtual void GetDomainComponents(CefStringList components)
 {
     NativeInstance->GetDomainComponents(components.GetNativeInstance());
     GC.KeepAlive(this);
 }
예제 #10
0
 /// <summary>
 /// Retrieve the list of street addresses.
 /// </summary>
 public unsafe virtual void GetStreetAddresses(CefStringList addresses)
 {
     NativeInstance->GetStreetAddresses(addresses.GetNativeInstance());
     GC.KeepAlive(this);
 }
예제 #11
0
 /// <summary>
 /// Get the remaining command line arguments.
 /// </summary>
 public unsafe virtual void GetArguments(CefStringList arguments)
 {
     NativeInstance->GetArguments(arguments.GetNativeInstance());
     GC.KeepAlive(this);
 }
예제 #12
0
 /// <summary>
 /// Reads all keys for this dictionary into the specified vector.
 /// </summary>
 public unsafe virtual int GetKeys(CefStringList keys)
 {
     return(SafeCall(NativeInstance->GetKeys(keys.GetNativeInstance())));
 }
예제 #13
0
 /// <summary>
 /// Set the schemes supported by this manager. If |include_defaults| is true
 /// (1) the default schemes (&quot;http&quot;, &quot;https&quot;, &quot;ws&quot; and &quot;wss&quot;) will also be
 /// supported. Calling this function with an NULL |schemes| value and
 /// |include_defaults| set to false (0) will disable all loading and saving of
 /// cookies for this manager. If |callback| is non-NULL it will be executed
 /// asnychronously on the UI thread after the change has been applied. Must be
 /// called before any cookies are accessed.
 /// </summary>
 public unsafe virtual void SetSupportedSchemes(CefStringList schemes, bool includeDefaults, CefCompletionCallback callback)
 {
     NativeInstance->SetSupportedSchemes(schemes.GetNativeInstance(), includeDefaults ? 1 : 0, (callback != null) ? callback.GetNativeInstance() : null);
     GC.KeepAlive(this);
 }
예제 #14
0
 /// <summary>
 /// Called on the UI thread after the ResolveHost request has completed.
 /// |result| will be the result code. |resolved_ips| will be the list of
 /// resolved IP addresses or NULL if the resolution failed.
 /// </summary>
 protected internal unsafe virtual void OnResolveCompleted(CefErrorCode result, CefStringList resolvedIps)
 {
 }
예제 #15
0
 /// <summary>
 /// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
 /// |suggestions| from the spell check service for the misspelled word if there
 /// is one.
 /// </summary>
 public unsafe virtual bool GetDictionarySuggestions(CefStringList suggestions)
 {
     return(SafeCall(NativeInstance->GetDictionarySuggestions(suggestions.GetNativeInstance()) != 0));
 }
예제 #16
0
 /// <summary>
 /// Called on the UI thread after the ResolveHost request has completed.
 /// |result| will be the result code. |resolved_ips| will be the list of
 /// resolved IP addresses or NULL if the resolution failed.
 /// </summary>
 public unsafe virtual void OnResolveCompleted(CefErrorCode result, CefStringList resolvedIps)
 {
 }
예제 #17
0
        /// <summary>
        /// Call to run a file chooser dialog. Only a single file chooser dialog may be
        /// pending at any given time. |mode| represents the type of dialog to display.
        /// |title| to the title to be used for the dialog and may be NULL to show the
        /// default title (&quot;Open&quot; or &quot;Save&quot; depending on the mode). |default_file_path|
        /// is the path with optional directory and/or file name component that will be
        /// initially selected in the dialog. |accept_filters| are used to restrict the
        /// selectable file types and may any combination of (a) valid lower-cased MIME
        /// types (e.g. &quot;text/*&quot; or &quot;image/*&quot;), (b) individual file extensions (e.g.
        /// &quot;.txt&quot; or &quot;.png&quot;), or (c) combined description and file extension delimited
        /// using &quot;|&quot; and &quot;;&quot; (e.g. &quot;Image Types|.png;.gif;.jpg&quot;).
        /// |selected_accept_filter| is the 0-based index of the filter that will be
        /// selected by default. |callback| will be executed after the dialog is
        /// dismissed or immediately if another dialog is already pending. The dialog
        /// will be initiated asynchronously on the UI thread.
        /// </summary>
        public unsafe virtual void RunFileDialog(CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, bool selectedAcceptFilter, CefRunFileDialogCallback callback)
        {
            fixed(char *s1 = title)
            fixed(char *s2 = defaultFilePath)
            {
                var cstr1 = new cef_string_t {
                    Str = s1, Length = title != null ? title.Length : 0
                };
                var cstr2 = new cef_string_t {
                    Str = s2, Length = defaultFilePath != null ? defaultFilePath.Length : 0
                };

                NativeInstance->RunFileDialog(mode, &cstr1, &cstr2, acceptFilters.GetNativeInstance(), selectedAcceptFilter ? 1 : 0, (callback != null) ? callback.GetNativeInstance() : null);
            }
            GC.KeepAlive(this);
        }
예제 #18
0
 /// <summary>
 /// Returns the names of all existing frames.
 /// </summary>
 public unsafe virtual void GetFrameNames(CefStringList names)
 {
     NativeInstance->GetFrameNames(names.GetNativeInstance());
     GC.KeepAlive(this);
 }
예제 #19
0
 /// <summary>
 /// Retrieve the list of file names that are being dragged into the browser
 /// window.
 /// </summary>
 public unsafe virtual int GetFileNames(CefStringList names)
 {
     return(SafeCall(NativeInstance->GetFileNames(names.GetNativeInstance())));
 }
예제 #20
0
 /// <summary>
 /// Called asynchronously after the file dialog is dismissed.
 /// |selected_accept_filter| is the 0-based index of the value selected from
 /// the accept filters array passed to cef_browser_host_t::RunFileDialog.
 /// |file_paths| will be a single value or a list of values depending on the
 /// dialog mode. If the selection was cancelled |file_paths| will be NULL.
 /// </summary>
 protected internal unsafe virtual void OnFileDialogDismissed(bool selectedAcceptFilter, CefStringList filePaths)
 {
 }
예제 #21
0
 /// <summary>
 /// Called when the page icon changes.
 /// </summary>
 public unsafe virtual void OnFaviconUrlChange(CefBrowser browser, CefStringList iconUrls)
 {
 }
예제 #22
0
 /// <summary>
 /// Continue the file selection. |selected_accept_filter| should be the 0-based
 /// index of the value selected from the accept filters array passed to
 /// cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value
 /// or a list of values depending on the dialog mode. An NULL |file_paths|
 /// value is treated the same as calling cancel().
 /// </summary>
 public unsafe virtual void Continue(bool selectedAcceptFilter, CefStringList filePaths)
 {
     NativeInstance->Continue(selectedAcceptFilter ? 1 : 0, filePaths.GetNativeInstance());
     GC.KeepAlive(this);
 }
예제 #23
0
 /// <summary>
 /// Called to run a file chooser dialog. |mode| represents the type of dialog
 /// to display. |title| to the title to be used for the dialog and may be NULL
 /// to show the default title (&quot;Open&quot; or &quot;Save&quot; depending on the mode).
 /// |default_file_path| is the path with optional directory and/or file name
 /// component that should be initially selected in the dialog. |accept_filters|
 /// are used to restrict the selectable file types and may any combination of
 /// (a) valid lower-cased MIME types (e.g. &quot;text/*&quot; or &quot;image/*&quot;), (b)
 /// individual file extensions (e.g. &quot;.txt&quot; or &quot;.png&quot;), or (c) combined
 /// description and file extension delimited using &quot;|&quot; and &quot;;&quot; (e.g. &quot;Image
 /// Types|.png;.gif;.jpg&quot;). |selected_accept_filter| is the 0-based index of
 /// the filter that should be selected by default. To display a custom dialog
 /// return true (1) and execute |callback| either inline or at a later time. To
 /// display the default dialog return false (0).
 /// </summary>
 protected internal unsafe virtual bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
 {
     return(default);