Esempio n. 1
0
        /// <summary>
        /// Sets the value at the specified key as type dict. Returns true (1) if the
        /// value was set successfully. If |value| is currently owned by another object
        /// then the value will be copied and the |value| reference will not change.
        /// Otherwise, ownership will be transferred to this object and the |value|
        /// reference will be invalidated.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
        /// </remarks>
        public bool SetDictionary(string key, CfxDictionaryValue value)
        {
            var key_pinned = new PinnedString(key);
            var __retval   = CfxApi.DictionaryValue.cfx_dictionary_value_set_dictionary(NativePtr, key_pinned.Obj.PinnedPtr, key_pinned.Length, CfxDictionaryValue.Unwrap(value));

            key_pinned.Obj.Free();
            return(0 != __retval);
        }
Esempio n. 2
0
 /// <summary>
 /// Sets the value at the specified index as type dict. Returns true (1) if the
 /// value was set successfully. If |value| is currently owned by another object
 /// then the value will be copied and the |value| reference will not change.
 /// Otherwise, ownership will be transferred to this object and the |value|
 /// reference will be invalidated.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool SetDictionary(int index, CfxDictionaryValue value)
 {
     return(0 != CfxApi.cfx_list_value_set_dictionary(NativePtr, index, CfxDictionaryValue.Unwrap(value)));
 }
Esempio n. 3
0
 /// <summary>
 /// Returns true (1) if this object and |that| object have an equivalent
 /// underlying value but are not necessarily the same object.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool IsEqual(CfxDictionaryValue that)
 {
     return(0 != CfxApi.DictionaryValue.cfx_dictionary_value_is_equal(NativePtr, CfxDictionaryValue.Unwrap(that)));
 }
Esempio n. 4
0
        /// <summary>
        /// Load an extension.
        ///
        /// If extension resources will be read from disk using the default load
        /// implementation then |rootDirectory| should be the absolute path to the
        /// extension resources directory and |manifest| should be NULL. If extension
        /// resources will be provided by the client (e.g. via CfxRequestHandler
        /// and/or CfxExtensionHandler) then |rootDirectory| should be a path
        /// component unique to the extension (if not absolute this will be internally
        /// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the
        /// contents that would otherwise be read from the "manifest.json" file on
        /// disk.
        ///
        /// The loaded extension will be accessible in all contexts sharing the same
        /// storage (HasExtension returns true (1)). However, only the context on which
        /// this function was called is considered the loader (DidLoadExtension returns
        /// true (1)) and only the loader will receive CfxRequestContextHandler
        /// callbacks for the extension.
        ///
        /// CfxExtensionHandler.OnExtensionLoaded will be called on load success or
        /// CfxExtensionHandler.OnExtensionLoadFailed will be called on load
        /// failure.
        ///
        /// If the extension specifies a background script via the "background"
        /// manifest key then CfxExtensionHandler.OnBeforeBackgroundBrowser will be
        /// called to create the background browser. See that function for additional
        /// information about background scripts.
        ///
        /// For visible extension views the client application should evaluate the
        /// manifest to determine the correct extension URL to load and then pass that
        /// URL to the CfxBrowserHost.CreateBrowser* function after the extension
        /// has loaded. For example, the client can look for the "browser_action"
        /// manifest key as documented at
        /// https://developer.chrome.com/extensions/browserAction. Extension URLs take
        /// the form "chrome-extension://&lt;extension_id>/&lt;path>".
        ///
        /// Browsers that host extensions differ from normal browsers as follows:
        ///  - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit
        ///    chrome://extensions-support for the list of extension APIs currently
        ///    supported by CEF.
        ///  - Main frame navigation to non-extension content is blocked.
        ///  - Pinch-zooming is disabled.
        ///  - CfxBrowserHost.GetExtension returns the hosted extension.
        ///  - CfxBrowserHost.IsBackgroundHost returns true for background hosts.
        ///
        /// See https://developer.chrome.com/extensions for extension implementation
        /// and usage documentation.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_context_capi.h">cef/include/capi/cef_request_context_capi.h</see>.
        /// </remarks>
        public void LoadExtension(string rootDirectory, CfxDictionaryValue manifest, CfxExtensionHandler handler)
        {
            var rootDirectory_pinned = new PinnedString(rootDirectory);

            CfxApi.RequestContext.cfx_request_context_load_extension(NativePtr, rootDirectory_pinned.Obj.PinnedPtr, rootDirectory_pinned.Length, CfxDictionaryValue.Unwrap(manifest), CfxExtensionHandler.Unwrap(handler));
            rootDirectory_pinned.Obj.Free();
        }
Esempio n. 5
0
 /// <summary>
 /// Returns true (1) if this object and |that| object have the same underlying
 /// data. If true (1) modifications to this object will also affect |that|
 /// object and vice-versa.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool IsSame(CfxDictionaryValue that)
 {
     return(0 != CfxApi.cfx_dictionary_value_is_same(NativePtr, CfxDictionaryValue.Unwrap(that)));
 }
 /// <summary>
 /// Sets the underlying value as type dict. Returns true (1) if the value was
 /// set successfully. This object keeps a reference to |value| and ownership of
 /// the underlying data remains unchanged.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool SetDictionary(CfxDictionaryValue value)
 {
     return(0 != CfxApi.Value.cfx_value_set_dictionary(NativePtr, CfxDictionaryValue.Unwrap(value)));
 }
Esempio n. 7
0
 /// <summary>
 /// Sets the value at the specified index as type dict. Returns true (1) if the
 /// value was set successfully. If |value| is currently owned by another object
 /// then the value will be copied and the |value| reference will not change.
 /// Otherwise, ownership will be transferred to this object and the |value|
 /// reference will be invalidated.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public bool SetDictionary(ulong index, CfxDictionaryValue value)
 {
     return(0 != CfxApi.ListValue.cfx_list_value_set_dictionary(NativePtr, (UIntPtr)index, CfxDictionaryValue.Unwrap(value)));
 }