github.com/ckxng/wakeup@v0.0.0-20190105202853-90356a5f5a15/include/internal/cef_types.h (about)

     1  // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
     2  //
     3  // Redistribution and use in source and binary forms, with or without
     4  // modification, are permitted provided that the following conditions are
     5  // met:
     6  //
     7  //    * Redistributions of source code must retain the above copyright
     8  // notice, this list of conditions and the following disclaimer.
     9  //    * Redistributions in binary form must reproduce the above
    10  // copyright notice, this list of conditions and the following disclaimer
    11  // in the documentation and/or other materials provided with the
    12  // distribution.
    13  //    * Neither the name of Google Inc. nor the name Chromium Embedded
    14  // Framework nor the names of its contributors may be used to endorse
    15  // or promote products derived from this software without specific prior
    16  // written permission.
    17  //
    18  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    19  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    20  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    21  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    22  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    23  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    24  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    25  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    26  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    27  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    28  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    29  
    30  
    31  #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
    32  #define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
    33  #pragma once
    34  
    35  #include "include/internal/cef_build.h"
    36  #include "include/internal/cef_string.h"
    37  #include "include/internal/cef_string_list.h"
    38  #include "include/internal/cef_time.h"
    39  
    40  // Bring in platform-specific definitions.
    41  #if defined(OS_WIN)
    42  #include "include/internal/cef_types_win.h"
    43  #elif defined(OS_MACOSX)
    44  #include "include/internal/cef_types_mac.h"
    45  #elif defined(OS_LINUX)
    46  #include "include/internal/cef_types_linux.h"
    47  #endif
    48  
    49  #include <limits.h>         // For UINT_MAX
    50  #include <stddef.h>         // For size_t
    51  
    52  // The NSPR system headers define 64-bit as |long| when possible, except on
    53  // Mac OS X.  In order to not have typedef mismatches, we do the same on LP64.
    54  //
    55  // On Mac OS X, |long long| is used for 64-bit types for compatibility with
    56  // <inttypes.h> format macros even in the LP64 model.
    57  #if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
    58  typedef long                int64;  // NOLINT(runtime/int)
    59  typedef unsigned long       uint64;  // NOLINT(runtime/int)
    60  #else
    61  typedef long long           int64;  // NOLINT(runtime/int)
    62  typedef unsigned long long  uint64;  // NOLINT(runtime/int)
    63  #endif
    64  
    65  // TODO: Remove these type guards.  These are to avoid conflicts with
    66  // obsolete/protypes.h in the Gecko SDK.
    67  #ifndef _INT32
    68  #define _INT32
    69  typedef int                 int32;
    70  #endif
    71  
    72  // TODO: Remove these type guards.  These are to avoid conflicts with
    73  // obsolete/protypes.h in the Gecko SDK.
    74  #ifndef _UINT32
    75  #define _UINT32
    76  typedef unsigned int       uint32;
    77  #endif
    78  
    79  // UTF-16 character type
    80  #ifndef char16
    81  #if defined(WIN32)
    82  typedef wchar_t             char16;
    83  #else
    84  typedef unsigned short      char16;
    85  #endif
    86  #endif
    87  
    88  // 32-bit ARGB color value, not premultiplied. The color components are always
    89  // in a known order. Equivalent to the SkColor type.
    90  typedef uint32              cef_color_t;
    91  
    92  // Return the alpha byte from a cef_color_t value.
    93  #define CefColorGetA(color)      (((color) >> 24) & 0xFF)
    94  // Return the red byte from a cef_color_t value.
    95  #define CefColorGetR(color)      (((color) >> 16) & 0xFF)
    96  // Return the green byte from a cef_color_t value.
    97  #define CefColorGetG(color)      (((color) >>  8) & 0xFF)
    98  // Return the blue byte from a cef_color_t value.
    99  #define CefColorGetB(color)      (((color) >>  0) & 0xFF)
   100  
   101  // Return an cef_color_t value with the specified byte component values.
   102  #define CefColorSetARGB(a, r, g, b) \
   103      static_cast<cef_color_t>( \
   104          (static_cast<unsigned>(a) << 24) | \
   105          (static_cast<unsigned>(r) << 16) | \
   106          (static_cast<unsigned>(g) << 8) | \
   107          (static_cast<unsigned>(b) << 0))
   108  
   109  // Return an int64 value with the specified low and high int32 component values.
   110  #define CefInt64Set(int32_low, int32_high) \
   111      static_cast<int64>((static_cast<uint32>(int32_low)) | \
   112          (static_cast<int64>(static_cast<int32>(int32_high))) << 32)
   113  
   114  // Return the low int32 value from an int64 value.
   115  #define CefInt64GetLow(int64_val) static_cast<int32>(int64_val)
   116  // Return the high int32 value from an int64 value.
   117  #define CefInt64GetHigh(int64_val) \
   118      static_cast<int32>((static_cast<int64>(int64_val) >> 32) & 0xFFFFFFFFL)
   119  
   120  
   121  #ifdef __cplusplus
   122  extern "C" {
   123  #endif
   124  
   125  ///
   126  // Log severity levels.
   127  ///
   128  typedef enum {
   129    ///
   130    // Default logging (currently INFO logging).
   131    ///
   132    LOGSEVERITY_DEFAULT,
   133  
   134    ///
   135    // Verbose logging.
   136    ///
   137    LOGSEVERITY_VERBOSE,
   138  
   139    ///
   140    // INFO logging.
   141    ///
   142    LOGSEVERITY_INFO,
   143  
   144    ///
   145    // WARNING logging.
   146    ///
   147    LOGSEVERITY_WARNING,
   148  
   149    ///
   150    // ERROR logging.
   151    ///
   152    LOGSEVERITY_ERROR,
   153  
   154    ///
   155    // ERROR_REPORT logging.
   156    ///
   157    LOGSEVERITY_ERROR_REPORT,
   158  
   159    ///
   160    // Completely disable logging.
   161    ///
   162    LOGSEVERITY_DISABLE = 99
   163  } cef_log_severity_t;
   164  
   165  ///
   166  // Represents the state of a setting.
   167  ///
   168  typedef enum {
   169    ///
   170    // Use the default state for the setting.
   171    ///
   172    STATE_DEFAULT = 0,
   173  
   174    ///
   175    // Enable or allow the setting.
   176    ///
   177    STATE_ENABLED,
   178  
   179    ///
   180    // Disable or disallow the setting.
   181    ///
   182    STATE_DISABLED,
   183  } cef_state_t;
   184  
   185  ///
   186  // Initialization settings. Specify NULL or 0 to get the recommended default
   187  // values. Many of these and other settings can also configured using command-
   188  // line switches.
   189  ///
   190  typedef struct _cef_settings_t {
   191    ///
   192    // Size of this structure.
   193    ///
   194    size_t size;
   195  
   196    ///
   197    // Set to true (1) to use a single process for the browser and renderer. This
   198    // run mode is not officially supported by Chromium and is less stable than
   199    // the multi-process default. Also configurable using the "single-process"
   200    // command-line switch.
   201    ///
   202    int single_process;
   203  
   204    ///
   205    // Set to true (1) to disable the sandbox for sub-processes. See
   206    // cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
   207    // configurable using the "no-sandbox" command-line switch.
   208    ///
   209    int no_sandbox;
   210  
   211    ///
   212    // The path to a separate executable that will be launched for sub-processes.
   213    // By default the browser process executable is used. See the comments on
   214    // CefExecuteProcess() for details. Also configurable using the
   215    // "browser-subprocess-path" command-line switch.
   216    ///
   217    cef_string_t browser_subprocess_path;
   218  
   219    ///
   220    // Set to true (1) to have the browser process message loop run in a separate
   221    // thread. If false (0) than the CefDoMessageLoopWork() function must be
   222    // called from your application message loop.
   223    ///
   224    int multi_threaded_message_loop;
   225  
   226    ///
   227    // Set to true (1) to disable configuration of browser process features using
   228    // standard CEF and Chromium command-line arguments. Configuration can still
   229    // be specified using CEF data structures or via the
   230    // CefApp::OnBeforeCommandLineProcessing() method.
   231    ///
   232    int command_line_args_disabled;
   233  
   234    ///
   235    // The location where cache data will be stored on disk. If empty an in-memory
   236    // cache will be used for some features and a temporary disk cache for others.
   237    // HTML5 databases such as localStorage will only persist across sessions if a
   238    // cache path is specified.
   239    ///
   240    cef_string_t cache_path;
   241  
   242    ///
   243    // To persist session cookies (cookies without an expiry date or validity
   244    // interval) by default when using the global cookie manager set this value to
   245    // true. Session cookies are generally intended to be transient and most Web
   246    // browsers do not persist them. A |cache_path| value must also be specified to
   247    // enable this feature. Also configurable using the "persist-session-cookies"
   248    // command-line switch.
   249    ///
   250    int persist_session_cookies;
   251  
   252    ///
   253    // Value that will be returned as the User-Agent HTTP header. If empty the
   254    // default User-Agent string will be used. Also configurable using the
   255    // "user-agent" command-line switch.
   256    ///
   257    cef_string_t user_agent;
   258  
   259    ///
   260    // Value that will be inserted as the product portion of the default
   261    // User-Agent string. If empty the Chromium product version will be used. If
   262    // |userAgent| is specified this value will be ignored. Also configurable
   263    // using the "product-version" command-line switch.
   264    ///
   265    cef_string_t product_version;
   266  
   267    ///
   268    // The locale string that will be passed to WebKit. If empty the default
   269    // locale of "en-US" will be used. This value is ignored on Linux where locale
   270    // is determined using environment variable parsing with the precedence order:
   271    // LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang"
   272    // command-line switch.
   273    ///
   274    cef_string_t locale;
   275  
   276    ///
   277    // The directory and file name to use for the debug log. If empty, the
   278    // default name of "debug.log" will be used and the file will be written
   279    // to the application directory. Also configurable using the "log-file"
   280    // command-line switch.
   281    ///
   282    cef_string_t log_file;
   283  
   284    ///
   285    // The log severity. Only messages of this severity level or higher will be
   286    // logged. Also configurable using the "log-severity" command-line switch with
   287    // a value of "verbose", "info", "warning", "error", "error-report" or
   288    // "disable".
   289    ///
   290    cef_log_severity_t log_severity;
   291  
   292    ///
   293    // Enable DCHECK in release mode to ease debugging. Also configurable using the
   294    // "enable-release-dcheck" command-line switch.
   295    ///
   296    int release_dcheck_enabled;
   297  
   298    ///
   299    // Custom flags that will be used when initializing the V8 JavaScript engine.
   300    // The consequences of using custom flags may not be well tested. Also
   301    // configurable using the "js-flags" command-line switch.
   302    ///
   303    cef_string_t javascript_flags;
   304  
   305    ///
   306    // The fully qualified path for the resources directory. If this value is
   307    // empty the cef.pak and/or devtools_resources.pak files must be located in
   308    // the module directory on Windows/Linux or the app bundle Resources directory
   309    // on Mac OS X. Also configurable using the "resources-dir-path" command-line
   310    // switch.
   311    ///
   312    cef_string_t resources_dir_path;
   313  
   314    ///
   315    // The fully qualified path for the locales directory. If this value is empty
   316    // the locales directory must be located in the module directory. This value
   317    // is ignored on Mac OS X where pack files are always loaded from the app
   318    // bundle Resources directory. Also configurable using the "locales-dir-path"
   319    // command-line switch.
   320    ///
   321    cef_string_t locales_dir_path;
   322  
   323    ///
   324    // Set to true (1) to disable loading of pack files for resources and locales.
   325    // A resource bundle handler must be provided for the browser and render
   326    // processes via CefApp::GetResourceBundleHandler() if loading of pack files
   327    // is disabled. Also configurable using the "disable-pack-loading" command-
   328    // line switch.
   329    ///
   330    int pack_loading_disabled;
   331  
   332    ///
   333    // Set to a value between 1024 and 65535 to enable remote debugging on the
   334    // specified port. For example, if 8080 is specified the remote debugging URL
   335    // will be http://localhost:8080. CEF can be remotely debugged from any CEF or
   336    // Chrome browser window. Also configurable using the "remote-debugging-port"
   337    // command-line switch.
   338    ///
   339    int remote_debugging_port;
   340  
   341    ///
   342    // The number of stack trace frames to capture for uncaught exceptions.
   343    // Specify a positive value to enable the CefV8ContextHandler::
   344    // OnUncaughtException() callback. Specify 0 (default value) and
   345    // OnUncaughtException() will not be called. Also configurable using the
   346    // "uncaught-exception-stack-size" command-line switch.
   347    ///
   348    int uncaught_exception_stack_size;
   349  
   350    ///
   351    // By default CEF V8 references will be invalidated (the IsValid() method will
   352    // return false) after the owning context has been released. This reduces the
   353    // need for external record keeping and avoids crashes due to the use of V8
   354    // references after the associated context has been released.
   355    //
   356    // CEF currently offers two context safety implementations with different
   357    // performance characteristics. The default implementation (value of 0) uses a
   358    // map of hash values and should provide better performance in situations with
   359    // a small number contexts. The alternate implementation (value of 1) uses a
   360    // hidden value attached to each context and should provide better performance
   361    // in situations with a large number of contexts.
   362    //
   363    // If you need better performance in the creation of V8 references and you
   364    // plan to manually track context lifespan you can disable context safety by
   365    // specifying a value of -1.
   366    //
   367    // Also configurable using the "context-safety-implementation" command-line
   368    // switch.
   369    ///
   370    int context_safety_implementation;
   371  
   372    ///
   373    // Set to true (1) to ignore errors related to invalid SSL certificates.
   374    // Enabling this setting can lead to potential security vulnerabilities like
   375    // "man in the middle" attacks. Applications that load content from the
   376    // internet should not enable this setting. Also configurable using the
   377    // "ignore-certificate-errors" command-line switch.
   378    ///
   379    int ignore_certificate_errors;
   380  
   381    ///
   382    // Opaque background color used for accelerated content. By default the
   383    // background color will be white. Only the RGB compontents of the specified
   384    // value will be used. The alpha component must greater than 0 to enable use
   385    // of the background color but will be otherwise ignored.
   386    ///
   387    cef_color_t background_color;
   388  } cef_settings_t;
   389  
   390  ///
   391  // Browser initialization settings. Specify NULL or 0 to get the recommended
   392  // default values. The consequences of using custom values may not be well
   393  // tested. Many of these and other settings can also configured using command-
   394  // line switches.
   395  ///
   396  typedef struct _cef_browser_settings_t {
   397    ///
   398    // Size of this structure.
   399    ///
   400    size_t size;
   401  
   402    // The below values map to WebPreferences settings.
   403  
   404    ///
   405    // Font settings.
   406    ///
   407    cef_string_t standard_font_family;
   408    cef_string_t fixed_font_family;
   409    cef_string_t serif_font_family;
   410    cef_string_t sans_serif_font_family;
   411    cef_string_t cursive_font_family;
   412    cef_string_t fantasy_font_family;
   413    int default_font_size;
   414    int default_fixed_font_size;
   415    int minimum_font_size;
   416    int minimum_logical_font_size;
   417  
   418    ///
   419    // Default encoding for Web content. If empty "ISO-8859-1" will be used. Also
   420    // configurable using the "default-encoding" command-line switch.
   421    ///
   422    cef_string_t default_encoding;
   423  
   424    ///
   425    // Controls the loading of fonts from remote sources. Also configurable using
   426    // the "disable-remote-fonts" command-line switch.
   427    ///
   428    cef_state_t remote_fonts;
   429  
   430    ///
   431    // Controls whether JavaScript can be executed. Also configurable using the
   432    // "disable-javascript" command-line switch.
   433    ///
   434    cef_state_t javascript;
   435  
   436    ///
   437    // Controls whether JavaScript can be used for opening windows. Also
   438    // configurable using the "disable-javascript-open-windows" command-line
   439    // switch.
   440    ///
   441    cef_state_t javascript_open_windows;
   442  
   443    ///
   444    // Controls whether JavaScript can be used to close windows that were not
   445    // opened via JavaScript. JavaScript can still be used to close windows that
   446    // were opened via JavaScript. Also configurable using the
   447    // "disable-javascript-close-windows" command-line switch.
   448    ///
   449    cef_state_t javascript_close_windows;
   450  
   451    ///
   452    // Controls whether JavaScript can access the clipboard. Also configurable
   453    // using the "disable-javascript-access-clipboard" command-line switch.
   454    ///
   455    cef_state_t javascript_access_clipboard;
   456  
   457    ///
   458    // Controls whether DOM pasting is supported in the editor via
   459    // execCommand("paste"). The |javascript_access_clipboard| setting must also
   460    // be enabled. Also configurable using the "disable-javascript-dom-paste"
   461    // command-line switch.
   462    ///
   463    cef_state_t javascript_dom_paste;
   464  
   465    ///
   466    // Controls whether the caret position will be drawn. Also configurable using
   467    // the "enable-caret-browsing" command-line switch.
   468    ///
   469    cef_state_t caret_browsing;
   470  
   471    ///
   472    // Controls whether the Java plugin will be loaded. Also configurable using
   473    // the "disable-java" command-line switch.
   474    ///
   475    cef_state_t java;
   476  
   477    ///
   478    // Controls whether any plugins will be loaded. Also configurable using the
   479    // "disable-plugins" command-line switch.
   480    ///
   481    cef_state_t plugins;
   482  
   483    ///
   484    // Controls whether file URLs will have access to all URLs. Also configurable
   485    // using the "allow-universal-access-from-files" command-line switch.
   486    ///
   487    cef_state_t universal_access_from_file_urls;
   488  
   489    ///
   490    // Controls whether file URLs will have access to other file URLs. Also
   491    // configurable using the "allow-access-from-files" command-line switch.
   492    ///
   493    cef_state_t file_access_from_file_urls;
   494  
   495    ///
   496    // Controls whether web security restrictions (same-origin policy) will be
   497    // enforced. Disabling this setting is not recommend as it will allow risky
   498    // security behavior such as cross-site scripting (XSS). Also configurable
   499    // using the "disable-web-security" command-line switch.
   500    ///
   501    cef_state_t web_security;
   502  
   503    ///
   504    // Controls whether image URLs will be loaded from the network. A cached image
   505    // will still be rendered if requested. Also configurable using the
   506    // "disable-image-loading" command-line switch.
   507    ///
   508    cef_state_t image_loading;
   509  
   510    ///
   511    // Controls whether standalone images will be shrunk to fit the page. Also
   512    // configurable using the "image-shrink-standalone-to-fit" command-line
   513    // switch.
   514    ///
   515    cef_state_t image_shrink_standalone_to_fit;
   516  
   517    ///
   518    // Controls whether text areas can be resized. Also configurable using the
   519    // "disable-text-area-resize" command-line switch.
   520    ///
   521    cef_state_t text_area_resize;
   522  
   523    ///
   524    // Controls whether the tab key can advance focus to links. Also configurable
   525    // using the "disable-tab-to-links" command-line switch.
   526    ///
   527    cef_state_t tab_to_links;
   528  
   529    ///
   530    // Controls whether local storage can be used. Also configurable using the
   531    // "disable-local-storage" command-line switch.
   532    ///
   533    cef_state_t local_storage;
   534  
   535    ///
   536    // Controls whether databases can be used. Also configurable using the
   537    // "disable-databases" command-line switch.
   538    ///
   539    cef_state_t databases;
   540  
   541    ///
   542    // Controls whether the application cache can be used. Also configurable using
   543    // the "disable-application-cache" command-line switch.
   544    ///
   545    cef_state_t application_cache;
   546  
   547    ///
   548    // Controls whether WebGL can be used. Note that WebGL requires hardware
   549    // support and may not work on all systems even when enabled. Also
   550    // configurable using the "disable-webgl" command-line switch.
   551    ///
   552    cef_state_t webgl;
   553  
   554    ///
   555    // Controls whether content that depends on accelerated compositing can be
   556    // used. Note that accelerated compositing requires hardware support and may
   557    // not work on all systems even when enabled. Also configurable using the
   558    // "disable-accelerated-compositing" command-line switch.
   559    ///
   560    cef_state_t accelerated_compositing;
   561  } cef_browser_settings_t;
   562  
   563  ///
   564  // URL component parts.
   565  ///
   566  typedef struct _cef_urlparts_t {
   567    ///
   568    // The complete URL specification.
   569    ///
   570    cef_string_t spec;
   571  
   572    ///
   573    // Scheme component not including the colon (e.g., "http").
   574    ///
   575    cef_string_t scheme;
   576  
   577    ///
   578    // User name component.
   579    ///
   580    cef_string_t username;
   581  
   582    ///
   583    // Password component.
   584    ///
   585    cef_string_t password;
   586  
   587    ///
   588    // Host component. This may be a hostname, an IPv4 address or an IPv6 literal
   589    // surrounded by square brackets (e.g., "[2001:db8::1]").
   590    ///
   591    cef_string_t host;
   592  
   593    ///
   594    // Port number component.
   595    ///
   596    cef_string_t port;
   597  
   598    ///
   599    // Origin contains just the scheme, host, and port from a URL. Equivalent to
   600    // clearing any username and password, replacing the path with a slash, and
   601    // clearing everything after that. This value will be empty for non-standard
   602    // URLs.
   603    ///
   604    cef_string_t origin;
   605  
   606    ///
   607    // Path component including the first slash following the host.
   608    ///
   609    cef_string_t path;
   610  
   611    ///
   612    // Query string component (i.e., everything following the '?').
   613    ///
   614    cef_string_t query;
   615  } cef_urlparts_t;
   616  
   617  ///
   618  // Cookie information.
   619  ///
   620  typedef struct _cef_cookie_t {
   621    ///
   622    // The cookie name.
   623    ///
   624    cef_string_t name;
   625  
   626    ///
   627    // The cookie value.
   628    ///
   629    cef_string_t value;
   630  
   631    ///
   632    // If |domain| is empty a host cookie will be created instead of a domain
   633    // cookie. Domain cookies are stored with a leading "." and are visible to
   634    // sub-domains whereas host cookies are not.
   635    ///
   636    cef_string_t domain;
   637  
   638    ///
   639    // If |path| is non-empty only URLs at or below the path will get the cookie
   640    // value.
   641    ///
   642    cef_string_t path;
   643  
   644    ///
   645    // If |secure| is true the cookie will only be sent for HTTPS requests.
   646    ///
   647    int secure;
   648  
   649    ///
   650    // If |httponly| is true the cookie will only be sent for HTTP requests.
   651    ///
   652    int httponly;
   653  
   654    ///
   655    // The cookie creation date. This is automatically populated by the system on
   656    // cookie creation.
   657    ///
   658    cef_time_t creation;
   659  
   660    ///
   661    // The cookie last access date. This is automatically populated by the system
   662    // on access.
   663    ///
   664    cef_time_t last_access;
   665  
   666    ///
   667    // The cookie expiration date is only valid if |has_expires| is true.
   668    ///
   669    int has_expires;
   670    cef_time_t expires;
   671  } cef_cookie_t;
   672  
   673  ///
   674  // Process termination status values.
   675  ///
   676  typedef enum {
   677    ///
   678    // Non-zero exit status.
   679    ///
   680    TS_ABNORMAL_TERMINATION,
   681  
   682    ///
   683    // SIGKILL or task manager kill.
   684    ///
   685    TS_PROCESS_WAS_KILLED,
   686  
   687    ///
   688    // Segmentation fault.
   689    ///
   690    TS_PROCESS_CRASHED,
   691  } cef_termination_status_t;
   692  
   693  ///
   694  // Path key values.
   695  ///
   696  typedef enum {
   697    ///
   698    // Current directory.
   699    ///
   700    PK_DIR_CURRENT,
   701  
   702    ///
   703    // Directory containing PK_FILE_EXE.
   704    ///
   705    PK_DIR_EXE,
   706  
   707    ///
   708    // Directory containing PK_FILE_MODULE.
   709    ///
   710    PK_DIR_MODULE,
   711  
   712    ///
   713    // Temporary directory.
   714    ///
   715    PK_DIR_TEMP,
   716  
   717    ///
   718    // Path and filename of the current executable.
   719    ///
   720    PK_FILE_EXE,
   721  
   722    ///
   723    // Path and filename of the module containing the CEF code (usually the libcef
   724    // module).
   725    ///
   726    PK_FILE_MODULE,
   727  } cef_path_key_t;
   728  
   729  ///
   730  // Storage types.
   731  ///
   732  typedef enum {
   733    ST_LOCALSTORAGE = 0,
   734    ST_SESSIONSTORAGE,
   735  } cef_storage_type_t;
   736  
   737  ///
   738  // Supported error code values. See net\base\net_error_list.h for complete
   739  // descriptions of the error codes.
   740  ///
   741  typedef enum {
   742    ERR_NONE = 0,
   743    ERR_FAILED = -2,
   744    ERR_ABORTED = -3,
   745    ERR_INVALID_ARGUMENT = -4,
   746    ERR_INVALID_HANDLE = -5,
   747    ERR_FILE_NOT_FOUND = -6,
   748    ERR_TIMED_OUT = -7,
   749    ERR_FILE_TOO_BIG = -8,
   750    ERR_UNEXPECTED = -9,
   751    ERR_ACCESS_DENIED = -10,
   752    ERR_NOT_IMPLEMENTED = -11,
   753    ERR_CONNECTION_CLOSED = -100,
   754    ERR_CONNECTION_RESET = -101,
   755    ERR_CONNECTION_REFUSED = -102,
   756    ERR_CONNECTION_ABORTED = -103,
   757    ERR_CONNECTION_FAILED = -104,
   758    ERR_NAME_NOT_RESOLVED = -105,
   759    ERR_INTERNET_DISCONNECTED = -106,
   760    ERR_SSL_PROTOCOL_ERROR = -107,
   761    ERR_ADDRESS_INVALID = -108,
   762    ERR_ADDRESS_UNREACHABLE = -109,
   763    ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110,
   764    ERR_TUNNEL_CONNECTION_FAILED = -111,
   765    ERR_NO_SSL_VERSIONS_ENABLED = -112,
   766    ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113,
   767    ERR_SSL_RENEGOTIATION_REQUESTED = -114,
   768    ERR_CERT_COMMON_NAME_INVALID = -200,
   769    ERR_CERT_DATE_INVALID = -201,
   770    ERR_CERT_AUTHORITY_INVALID = -202,
   771    ERR_CERT_CONTAINS_ERRORS = -203,
   772    ERR_CERT_NO_REVOCATION_MECHANISM = -204,
   773    ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205,
   774    ERR_CERT_REVOKED = -206,
   775    ERR_CERT_INVALID = -207,
   776    ERR_CERT_END = -208,
   777    ERR_INVALID_URL = -300,
   778    ERR_DISALLOWED_URL_SCHEME = -301,
   779    ERR_UNKNOWN_URL_SCHEME = -302,
   780    ERR_TOO_MANY_REDIRECTS = -310,
   781    ERR_UNSAFE_REDIRECT = -311,
   782    ERR_UNSAFE_PORT = -312,
   783    ERR_INVALID_RESPONSE = -320,
   784    ERR_INVALID_CHUNKED_ENCODING = -321,
   785    ERR_METHOD_NOT_SUPPORTED = -322,
   786    ERR_UNEXPECTED_PROXY_AUTH = -323,
   787    ERR_EMPTY_RESPONSE = -324,
   788    ERR_RESPONSE_HEADERS_TOO_BIG = -325,
   789    ERR_CACHE_MISS = -400,
   790    ERR_INSECURE_RESPONSE = -501,
   791  } cef_errorcode_t;
   792  
   793  ///
   794  // "Verb" of a drag-and-drop operation as negotiated between the source and
   795  // destination. These constants match their equivalents in WebCore's
   796  // DragActions.h and should not be renumbered.
   797  ///
   798  typedef enum {
   799      DRAG_OPERATION_NONE    = 0,
   800      DRAG_OPERATION_COPY    = 1,
   801      DRAG_OPERATION_LINK    = 2,
   802      DRAG_OPERATION_GENERIC = 4,
   803      DRAG_OPERATION_PRIVATE = 8,
   804      DRAG_OPERATION_MOVE    = 16,
   805      DRAG_OPERATION_DELETE  = 32,
   806      DRAG_OPERATION_EVERY   = UINT_MAX
   807  } cef_drag_operations_mask_t;
   808  
   809  ///
   810  // V8 access control values.
   811  ///
   812  typedef enum {
   813    V8_ACCESS_CONTROL_DEFAULT               = 0,
   814    V8_ACCESS_CONTROL_ALL_CAN_READ          = 1,
   815    V8_ACCESS_CONTROL_ALL_CAN_WRITE         = 1 << 1,
   816    V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2
   817  } cef_v8_accesscontrol_t;
   818  
   819  ///
   820  // V8 property attribute values.
   821  ///
   822  typedef enum {
   823    V8_PROPERTY_ATTRIBUTE_NONE       = 0,       // Writeable, Enumerable,
   824                                                //   Configurable
   825    V8_PROPERTY_ATTRIBUTE_READONLY   = 1 << 0,  // Not writeable
   826    V8_PROPERTY_ATTRIBUTE_DONTENUM   = 1 << 1,  // Not enumerable
   827    V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2   // Not configurable
   828  } cef_v8_propertyattribute_t;
   829  
   830  ///
   831  // Post data elements may represent either bytes or files.
   832  ///
   833  typedef enum {
   834    PDE_TYPE_EMPTY  = 0,
   835    PDE_TYPE_BYTES,
   836    PDE_TYPE_FILE,
   837  } cef_postdataelement_type_t;
   838  
   839  ///
   840  // Resource type for a request.
   841  ///
   842  typedef enum {
   843    ///
   844    // Top level page.
   845    ///
   846    RT_MAIN_FRAME = 0,
   847  
   848    ///
   849    // Frame or iframe.
   850    ///
   851    RT_SUB_FRAME,
   852  
   853    ///
   854    // CSS stylesheet.
   855    ///
   856    RT_STYLESHEET,
   857  
   858    ///
   859    // External script.
   860    ///
   861    RT_SCRIPT,
   862  
   863    ///
   864    // Image (jpg/gif/png/etc).
   865    ///
   866    RT_IMAGE,
   867  
   868    ///
   869    // Font.
   870    ///
   871    RT_FONT_RESOURCE,
   872  
   873    ///
   874    // Some other subresource. This is the default type if the actual type is
   875    // unknown.
   876    ///
   877    RT_SUB_RESOURCE,
   878  
   879    ///
   880    // Object (or embed) tag for a plugin, or a resource that a plugin requested.
   881    ///
   882    RT_OBJECT,
   883  
   884    ///
   885    // Media resource.
   886    ///
   887    RT_MEDIA,
   888  
   889    ///
   890    // Main resource of a dedicated worker.
   891    ///
   892    RT_WORKER,
   893  
   894    ///
   895    // Main resource of a shared worker.
   896    ///
   897    RT_SHARED_WORKER,
   898  
   899    ///
   900    // Explicitly requested prefetch.
   901    ///
   902    RT_PREFETCH,
   903  
   904    ///
   905    // Favicon.
   906    ///
   907    RT_FAVICON,
   908  
   909    ///
   910    // XMLHttpRequest.
   911    ///
   912    RT_XHR,
   913  } cef_resource_type_t;
   914  
   915  ///
   916  // Transition type for a request. Made up of one source value and 0 or more
   917  // qualifiers.
   918  ///
   919  typedef enum {
   920    ///
   921    // Source is a link click or the JavaScript window.open function. This is
   922    // also the default value for requests like sub-resource loads that are not
   923    // navigations.
   924    ///
   925    TT_LINK = 0,
   926  
   927    ///
   928    // Source is some other "explicit" navigation action such as creating a new
   929    // browser or using the LoadURL function. This is also the default value
   930    // for navigations where the actual type is unknown.
   931    ///
   932    TT_EXPLICIT = 1,
   933  
   934    ///
   935    // Source is a subframe navigation. This is any content that is automatically
   936    // loaded in a non-toplevel frame. For example, if a page consists of several
   937    // frames containing ads, those ad URLs will have this transition type.
   938    // The user may not even realize the content in these pages is a separate
   939    // frame, so may not care about the URL.
   940    ///
   941    TT_AUTO_SUBFRAME = 3,
   942  
   943    ///
   944    // Source is a subframe navigation explicitly requested by the user that will
   945    // generate new navigation entries in the back/forward list. These are
   946    // probably more important than frames that were automatically loaded in
   947    // the background because the user probably cares about the fact that this
   948    // link was loaded.
   949    ///
   950    TT_MANUAL_SUBFRAME = 4,
   951  
   952    ///
   953    // Source is a form submission by the user. NOTE: In some situations
   954    // submitting a form does not result in this transition type. This can happen
   955    // if the form uses a script to submit the contents.
   956    ///
   957    TT_FORM_SUBMIT = 7,
   958  
   959    ///
   960    // Source is a "reload" of the page via the Reload function or by re-visiting
   961    // the same URL. NOTE: This is distinct from the concept of whether a
   962    // particular load uses "reload semantics" (i.e. bypasses cached data).
   963    ///
   964    TT_RELOAD = 8,
   965  
   966    ///
   967    // General mask defining the bits used for the source values.
   968    ///
   969    TT_SOURCE_MASK = 0xFF,
   970  
   971    // Qualifiers.
   972    // Any of the core values above can be augmented by one or more qualifiers.
   973    // These qualifiers further define the transition.
   974  
   975    ///
   976    // Attempted to visit a URL but was blocked.
   977    ///
   978    TT_BLOCKED_FLAG = 0x00800000,
   979  
   980    ///
   981    // Used the Forward or Back function to navigate among browsing history.
   982    ///
   983    TT_FORWARD_BACK_FLAG = 0x01000000,
   984  
   985    ///
   986    // The beginning of a navigation chain.
   987    ///
   988    TT_CHAIN_START_FLAG = 0x10000000,
   989  
   990    ///
   991    // The last transition in a redirect chain.
   992    ///
   993    TT_CHAIN_END_FLAG = 0x20000000,
   994  
   995    ///
   996    // Redirects caused by JavaScript or a meta refresh tag on the page.
   997    ///
   998    TT_CLIENT_REDIRECT_FLAG = 0x40000000,
   999  
  1000    ///
  1001    // Redirects sent from the server by HTTP headers.
  1002    ///
  1003    TT_SERVER_REDIRECT_FLAG = 0x80000000,
  1004  
  1005    ///
  1006    // Used to test whether a transition involves a redirect.
  1007    ///
  1008    TT_IS_REDIRECT_MASK = 0xC0000000,
  1009  
  1010    ///
  1011    // General mask defining the bits used for the qualifiers.
  1012    ///
  1013    TT_QUALIFIER_MASK = 0xFFFFFF00,
  1014  } cef_transition_type_t;
  1015  
  1016  ///
  1017  // Flags used to customize the behavior of CefURLRequest.
  1018  ///
  1019  typedef enum {
  1020    ///
  1021    // Default behavior.
  1022    ///
  1023    UR_FLAG_NONE                      = 0,
  1024  
  1025    ///
  1026    // If set the cache will be skipped when handling the request.
  1027    ///
  1028    UR_FLAG_SKIP_CACHE                = 1 << 0,
  1029  
  1030    ///
  1031    // If set user name, password, and cookies may be sent with the request.
  1032    ///
  1033    UR_FLAG_ALLOW_CACHED_CREDENTIALS  = 1 << 1,
  1034  
  1035    ///
  1036    // If set cookies may be sent with the request and saved from the response.
  1037    // UR_FLAG_ALLOW_CACHED_CREDENTIALS must also be set.
  1038    ///
  1039    UR_FLAG_ALLOW_COOKIES             = 1 << 2,
  1040  
  1041    ///
  1042    // If set upload progress events will be generated when a request has a body.
  1043    ///
  1044    UR_FLAG_REPORT_UPLOAD_PROGRESS    = 1 << 3,
  1045  
  1046    ///
  1047    // If set load timing info will be collected for the request.
  1048    ///
  1049    UR_FLAG_REPORT_LOAD_TIMING        = 1 << 4,
  1050  
  1051    ///
  1052    // If set the headers sent and received for the request will be recorded.
  1053    ///
  1054    UR_FLAG_REPORT_RAW_HEADERS        = 1 << 5,
  1055  
  1056    ///
  1057    // If set the CefURLRequestClient::OnDownloadData method will not be called.
  1058    ///
  1059    UR_FLAG_NO_DOWNLOAD_DATA          = 1 << 6,
  1060  
  1061    ///
  1062    // If set 5XX redirect errors will be propagated to the observer instead of
  1063    // automatically re-tried. This currently only applies for requests
  1064    // originated in the browser process.
  1065    ///
  1066    UR_FLAG_NO_RETRY_ON_5XX           = 1 << 7,
  1067  } cef_urlrequest_flags_t;
  1068  
  1069  ///
  1070  // Flags that represent CefURLRequest status.
  1071  ///
  1072  typedef enum {
  1073    ///
  1074    // Unknown status.
  1075    ///
  1076    UR_UNKNOWN = 0,
  1077  
  1078    ///
  1079    // Request succeeded.
  1080    ///
  1081    UR_SUCCESS,
  1082  
  1083    ///
  1084    // An IO request is pending, and the caller will be informed when it is
  1085    // completed.
  1086    ///
  1087    UR_IO_PENDING,
  1088  
  1089    ///
  1090    // Request was canceled programatically.
  1091    ///
  1092    UR_CANCELED,
  1093  
  1094    ///
  1095    // Request failed for some reason.
  1096    ///
  1097    UR_FAILED,
  1098  } cef_urlrequest_status_t;
  1099  
  1100  ///
  1101  // Structure representing a rectangle.
  1102  ///
  1103  typedef struct _cef_rect_t {
  1104    int x;
  1105    int y;
  1106    int width;
  1107    int height;
  1108  } cef_rect_t;
  1109  
  1110  ///
  1111  // Existing process IDs.
  1112  ///
  1113  typedef enum {
  1114    ///
  1115    // Browser process.
  1116    ///
  1117    PID_BROWSER,
  1118    ///
  1119    // Renderer process.
  1120    ///
  1121    PID_RENDERER,
  1122  } cef_process_id_t;
  1123  
  1124  ///
  1125  // Existing thread IDs.
  1126  ///
  1127  typedef enum {
  1128  // BROWSER PROCESS THREADS -- Only available in the browser process.
  1129  
  1130    ///
  1131    // The main thread in the browser. This will be the same as the main
  1132    // application thread if CefInitialize() is called with a
  1133    // CefSettings.multi_threaded_message_loop value of false.
  1134    ///
  1135    TID_UI,
  1136  
  1137    ///
  1138    // Used to interact with the database.
  1139    ///
  1140    TID_DB,
  1141  
  1142    ///
  1143    // Used to interact with the file system.
  1144    ///
  1145    TID_FILE,
  1146  
  1147    ///
  1148    // Used for file system operations that block user interactions.
  1149    // Responsiveness of this thread affects users.
  1150    ///
  1151    TID_FILE_USER_BLOCKING,
  1152  
  1153    ///
  1154    // Used to launch and terminate browser processes.
  1155    ///
  1156    TID_PROCESS_LAUNCHER,
  1157  
  1158    ///
  1159    // Used to handle slow HTTP cache operations.
  1160    ///
  1161    TID_CACHE,
  1162  
  1163    ///
  1164    // Used to process IPC and network messages.
  1165    ///
  1166    TID_IO,
  1167  
  1168  // RENDER PROCESS THREADS -- Only available in the render process.
  1169  
  1170    ///
  1171    // The main thread in the renderer. Used for all WebKit and V8 interaction.
  1172    ///
  1173    TID_RENDERER,
  1174  } cef_thread_id_t;
  1175  
  1176  ///
  1177  // Supported value types.
  1178  ///
  1179  typedef enum {
  1180    VTYPE_INVALID = 0,
  1181    VTYPE_NULL,
  1182    VTYPE_BOOL,
  1183    VTYPE_INT,
  1184    VTYPE_DOUBLE,
  1185    VTYPE_STRING,
  1186    VTYPE_BINARY,
  1187    VTYPE_DICTIONARY,
  1188    VTYPE_LIST,
  1189  } cef_value_type_t;
  1190  
  1191  ///
  1192  // Supported JavaScript dialog types.
  1193  ///
  1194  typedef enum {
  1195    JSDIALOGTYPE_ALERT = 0,
  1196    JSDIALOGTYPE_CONFIRM,
  1197    JSDIALOGTYPE_PROMPT,
  1198  } cef_jsdialog_type_t;
  1199  
  1200  ///
  1201  // Screen information used when window rendering is disabled. This structure is
  1202  // passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled
  1203  // in by the client.
  1204  ///
  1205  typedef struct _cef_screen_info_t {
  1206    ///
  1207    // Device scale factor. Specifies the ratio between physical and logical
  1208    // pixels.
  1209    ///
  1210    float device_scale_factor;
  1211  
  1212    ///
  1213    // The screen depth in bits per pixel.
  1214    ///
  1215    int depth;
  1216  
  1217    ///
  1218    // The bits per color component. This assumes that the colors are balanced
  1219    // equally.
  1220    ///
  1221    int depth_per_component;
  1222  
  1223    ///
  1224    // This can be true for black and white printers.
  1225    ///
  1226    int is_monochrome;
  1227  
  1228    ///
  1229    // This is set from the rcMonitor member of MONITORINFOEX, to whit:
  1230    //   "A RECT structure that specifies the display monitor rectangle,
  1231    //   expressed in virtual-screen coordinates. Note that if the monitor
  1232    //   is not the primary display monitor, some of the rectangle's
  1233    //   coordinates may be negative values."
  1234    //
  1235    // The |rect| and |available_rect| properties are used to determine the
  1236    // available surface for rendering popup views.
  1237    ///
  1238    cef_rect_t rect;
  1239  
  1240    ///
  1241    // This is set from the rcWork member of MONITORINFOEX, to whit:
  1242    //   "A RECT structure that specifies the work area rectangle of the
  1243    //   display monitor that can be used by applications, expressed in
  1244    //   virtual-screen coordinates. Windows uses this rectangle to
  1245    //   maximize an application on the monitor. The rest of the area in
  1246    //   rcMonitor contains system windows such as the task bar and side
  1247    //   bars. Note that if the monitor is not the primary display monitor,
  1248    //   some of the rectangle's coordinates may be negative values".
  1249    //
  1250    // The |rect| and |available_rect| properties are used to determine the
  1251    // available surface for rendering popup views.
  1252    ///
  1253    cef_rect_t available_rect;
  1254  } cef_screen_info_t;
  1255  
  1256  ///
  1257  // Supported menu IDs. Non-English translations can be provided for the
  1258  // IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString().
  1259  ///
  1260  typedef enum {
  1261    // Navigation.
  1262    MENU_ID_BACK                = 100,
  1263    MENU_ID_FORWARD             = 101,
  1264    MENU_ID_RELOAD              = 102,
  1265    MENU_ID_RELOAD_NOCACHE      = 103,
  1266    MENU_ID_STOPLOAD            = 104,
  1267  
  1268    // Editing.
  1269    MENU_ID_UNDO                = 110,
  1270    MENU_ID_REDO                = 111,
  1271    MENU_ID_CUT                 = 112,
  1272    MENU_ID_COPY                = 113,
  1273    MENU_ID_PASTE               = 114,
  1274    MENU_ID_DELETE              = 115,
  1275    MENU_ID_SELECT_ALL          = 116,
  1276  
  1277    // Miscellaneous.
  1278    MENU_ID_FIND                = 130,
  1279    MENU_ID_PRINT               = 131,
  1280    MENU_ID_VIEW_SOURCE         = 132,
  1281  
  1282    // All user-defined menu IDs should come between MENU_ID_USER_FIRST and
  1283    // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges
  1284    // defined in the tools/gritsettings/resource_ids file.
  1285    MENU_ID_USER_FIRST          = 26500,
  1286    MENU_ID_USER_LAST           = 28500,
  1287  } cef_menu_id_t;
  1288  
  1289  ///
  1290  // Mouse button types.
  1291  ///
  1292  typedef enum {
  1293    MBT_LEFT   = 0,
  1294    MBT_MIDDLE,
  1295    MBT_RIGHT,
  1296  } cef_mouse_button_type_t;
  1297  
  1298  ///
  1299  // Structure representing mouse event information.
  1300  ///
  1301  typedef struct _cef_mouse_event_t {
  1302    ///
  1303    // X coordinate relative to the left side of the view.
  1304    ///
  1305    int x;
  1306  
  1307    ///
  1308    // Y coordinate relative to the top side of the view.
  1309    ///
  1310    int y;
  1311  
  1312    ///
  1313    // Bit flags describing any pressed modifier keys. See
  1314    // cef_event_flags_t for values.
  1315    ///
  1316    uint32 modifiers;
  1317  } cef_mouse_event_t;
  1318  
  1319  ///
  1320  // Paint element types.
  1321  ///
  1322  typedef enum {
  1323    PET_VIEW  = 0,
  1324    PET_POPUP,
  1325  } cef_paint_element_type_t;
  1326  
  1327  ///
  1328  // Supported event bit flags.
  1329  ///
  1330  typedef enum {
  1331    EVENTFLAG_NONE                = 0,
  1332    EVENTFLAG_CAPS_LOCK_ON        = 1 << 0,
  1333    EVENTFLAG_SHIFT_DOWN          = 1 << 1,
  1334    EVENTFLAG_CONTROL_DOWN        = 1 << 2,
  1335    EVENTFLAG_ALT_DOWN            = 1 << 3,
  1336    EVENTFLAG_LEFT_MOUSE_BUTTON   = 1 << 4,
  1337    EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5,
  1338    EVENTFLAG_RIGHT_MOUSE_BUTTON  = 1 << 6,
  1339    // Mac OS-X command key.
  1340    EVENTFLAG_COMMAND_DOWN        = 1 << 7,
  1341    EVENTFLAG_NUM_LOCK_ON         = 1 << 8,
  1342    EVENTFLAG_IS_KEY_PAD          = 1 << 9,
  1343    EVENTFLAG_IS_LEFT             = 1 << 10,
  1344    EVENTFLAG_IS_RIGHT            = 1 << 11,
  1345  } cef_event_flags_t;
  1346  
  1347  ///
  1348  // Supported menu item types.
  1349  ///
  1350  typedef enum {
  1351    MENUITEMTYPE_NONE,
  1352    MENUITEMTYPE_COMMAND,
  1353    MENUITEMTYPE_CHECK,
  1354    MENUITEMTYPE_RADIO,
  1355    MENUITEMTYPE_SEPARATOR,
  1356    MENUITEMTYPE_SUBMENU,
  1357  } cef_menu_item_type_t;
  1358  
  1359  ///
  1360  // Supported context menu type flags.
  1361  ///
  1362  typedef enum {
  1363    ///
  1364    // No node is selected.
  1365    ///
  1366    CM_TYPEFLAG_NONE        = 0,
  1367    ///
  1368    // The top page is selected.
  1369    ///
  1370    CM_TYPEFLAG_PAGE        = 1 << 0,
  1371    ///
  1372    // A subframe page is selected.
  1373    ///
  1374    CM_TYPEFLAG_FRAME       = 1 << 1,
  1375    ///
  1376    // A link is selected.
  1377    ///
  1378    CM_TYPEFLAG_LINK        = 1 << 2,
  1379    ///
  1380    // A media node is selected.
  1381    ///
  1382    CM_TYPEFLAG_MEDIA       = 1 << 3,
  1383    ///
  1384    // There is a textual or mixed selection that is selected.
  1385    ///
  1386    CM_TYPEFLAG_SELECTION   = 1 << 4,
  1387    ///
  1388    // An editable element is selected.
  1389    ///
  1390    CM_TYPEFLAG_EDITABLE    = 1 << 5,
  1391  } cef_context_menu_type_flags_t;
  1392  
  1393  ///
  1394  // Supported context menu media types.
  1395  ///
  1396  typedef enum {
  1397    ///
  1398    // No special node is in context.
  1399    ///
  1400    CM_MEDIATYPE_NONE,
  1401    ///
  1402    // An image node is selected.
  1403    ///
  1404    CM_MEDIATYPE_IMAGE,
  1405    ///
  1406    // A video node is selected.
  1407    ///
  1408    CM_MEDIATYPE_VIDEO,
  1409    ///
  1410    // An audio node is selected.
  1411    ///
  1412    CM_MEDIATYPE_AUDIO,
  1413    ///
  1414    // A file node is selected.
  1415    ///
  1416    CM_MEDIATYPE_FILE,
  1417    ///
  1418    // A plugin node is selected.
  1419    ///
  1420    CM_MEDIATYPE_PLUGIN,
  1421  } cef_context_menu_media_type_t;
  1422  
  1423  ///
  1424  // Supported context menu media state bit flags.
  1425  ///
  1426  typedef enum {
  1427    CM_MEDIAFLAG_NONE                  = 0,
  1428    CM_MEDIAFLAG_ERROR                 = 1 << 0,
  1429    CM_MEDIAFLAG_PAUSED                = 1 << 1,
  1430    CM_MEDIAFLAG_MUTED                 = 1 << 2,
  1431    CM_MEDIAFLAG_LOOP                  = 1 << 3,
  1432    CM_MEDIAFLAG_CAN_SAVE              = 1 << 4,
  1433    CM_MEDIAFLAG_HAS_AUDIO             = 1 << 5,
  1434    CM_MEDIAFLAG_HAS_VIDEO             = 1 << 6,
  1435    CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT  = 1 << 7,
  1436    CM_MEDIAFLAG_CAN_PRINT             = 1 << 8,
  1437    CM_MEDIAFLAG_CAN_ROTATE            = 1 << 9,
  1438  } cef_context_menu_media_state_flags_t;
  1439  
  1440  ///
  1441  // Supported context menu edit state bit flags.
  1442  ///
  1443  typedef enum {
  1444    CM_EDITFLAG_NONE            = 0,
  1445    CM_EDITFLAG_CAN_UNDO        = 1 << 0,
  1446    CM_EDITFLAG_CAN_REDO        = 1 << 1,
  1447    CM_EDITFLAG_CAN_CUT         = 1 << 2,
  1448    CM_EDITFLAG_CAN_COPY        = 1 << 3,
  1449    CM_EDITFLAG_CAN_PASTE       = 1 << 4,
  1450    CM_EDITFLAG_CAN_DELETE      = 1 << 5,
  1451    CM_EDITFLAG_CAN_SELECT_ALL  = 1 << 6,
  1452    CM_EDITFLAG_CAN_TRANSLATE   = 1 << 7,
  1453  } cef_context_menu_edit_state_flags_t;
  1454  
  1455  ///
  1456  // Key event types.
  1457  ///
  1458  typedef enum {
  1459    KEYEVENT_RAWKEYDOWN = 0,
  1460    KEYEVENT_KEYDOWN,
  1461    KEYEVENT_KEYUP,
  1462    KEYEVENT_CHAR
  1463  } cef_key_event_type_t;
  1464  
  1465  ///
  1466  // Structure representing keyboard event information.
  1467  ///
  1468  typedef struct _cef_key_event_t {
  1469    ///
  1470    // The type of keyboard event.
  1471    ///
  1472    cef_key_event_type_t type;
  1473  
  1474    ///
  1475    // Bit flags describing any pressed modifier keys. See
  1476    // cef_event_flags_t for values.
  1477    ///
  1478    uint32 modifiers;
  1479  
  1480    ///
  1481    // The Windows key code for the key event. This value is used by the DOM
  1482    // specification. Sometimes it comes directly from the event (i.e. on
  1483    // Windows) and sometimes it's determined using a mapping function. See
  1484    // WebCore/platform/chromium/KeyboardCodes.h for the list of values.
  1485    ///
  1486    int windows_key_code;
  1487  
  1488    ///
  1489    // The actual key code genenerated by the platform.
  1490    ///
  1491    int native_key_code;
  1492  
  1493    ///
  1494    // Indicates whether the event is considered a "system key" event (see
  1495    // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details).
  1496    // This value will always be false on non-Windows platforms.
  1497    ///
  1498    int is_system_key;
  1499  
  1500    ///
  1501    // The character generated by the keystroke.
  1502    ///
  1503    char16 character;
  1504  
  1505    ///
  1506    // Same as |character| but unmodified by any concurrently-held modifiers
  1507    // (except shift). This is useful for working out shortcut keys.
  1508    ///
  1509    char16 unmodified_character;
  1510  
  1511    ///
  1512    // True if the focus is currently on an editable field on the page. This is
  1513    // useful for determining if standard key events should be intercepted.
  1514    ///
  1515    int focus_on_editable_field;
  1516  } cef_key_event_t;
  1517  
  1518  ///
  1519  // Focus sources.
  1520  ///
  1521  typedef enum {
  1522    ///
  1523    // The source is explicit navigation via the API (LoadURL(), etc).
  1524    ///
  1525    FOCUS_SOURCE_NAVIGATION = 0,
  1526    ///
  1527    // The source is a system-generated focus event.
  1528    ///
  1529    FOCUS_SOURCE_SYSTEM,
  1530  } cef_focus_source_t;
  1531  
  1532  ///
  1533  // Navigation types.
  1534  ///
  1535  typedef enum {
  1536    NAVIGATION_LINK_CLICKED = 0,
  1537    NAVIGATION_FORM_SUBMITTED,
  1538    NAVIGATION_BACK_FORWARD,
  1539    NAVIGATION_RELOAD,
  1540    NAVIGATION_FORM_RESUBMITTED,
  1541    NAVIGATION_OTHER,
  1542  } cef_navigation_type_t;
  1543  
  1544  ///
  1545  // Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
  1546  // UTF16 (LE and BE) by default. All other types must be translated to UTF8
  1547  // before being passed to the parser. If a BOM is detected and the correct
  1548  // decoder is available then that decoder will be used automatically.
  1549  ///
  1550  typedef enum {
  1551    XML_ENCODING_NONE = 0,
  1552    XML_ENCODING_UTF8,
  1553    XML_ENCODING_UTF16LE,
  1554    XML_ENCODING_UTF16BE,
  1555    XML_ENCODING_ASCII,
  1556  } cef_xml_encoding_type_t;
  1557  
  1558  ///
  1559  // XML node types.
  1560  ///
  1561  typedef enum {
  1562    XML_NODE_UNSUPPORTED = 0,
  1563    XML_NODE_PROCESSING_INSTRUCTION,
  1564    XML_NODE_DOCUMENT_TYPE,
  1565    XML_NODE_ELEMENT_START,
  1566    XML_NODE_ELEMENT_END,
  1567    XML_NODE_ATTRIBUTE,
  1568    XML_NODE_TEXT,
  1569    XML_NODE_CDATA,
  1570    XML_NODE_ENTITY_REFERENCE,
  1571    XML_NODE_WHITESPACE,
  1572    XML_NODE_COMMENT,
  1573  } cef_xml_node_type_t;
  1574  
  1575  ///
  1576  // Popup window features.
  1577  ///
  1578  typedef struct _cef_popup_features_t {
  1579    int x;
  1580    int xSet;
  1581    int y;
  1582    int ySet;
  1583    int width;
  1584    int widthSet;
  1585    int height;
  1586    int heightSet;
  1587  
  1588    int menuBarVisible;
  1589    int statusBarVisible;
  1590    int toolBarVisible;
  1591    int locationBarVisible;
  1592    int scrollbarsVisible;
  1593    int resizable;
  1594  
  1595    int fullscreen;
  1596    int dialog;
  1597    cef_string_list_t additionalFeatures;
  1598  } cef_popup_features_t;
  1599  
  1600  ///
  1601  // DOM document types.
  1602  ///
  1603  typedef enum {
  1604    DOM_DOCUMENT_TYPE_UNKNOWN = 0,
  1605    DOM_DOCUMENT_TYPE_HTML,
  1606    DOM_DOCUMENT_TYPE_XHTML,
  1607    DOM_DOCUMENT_TYPE_PLUGIN,
  1608  } cef_dom_document_type_t;
  1609  
  1610  ///
  1611  // DOM event category flags.
  1612  ///
  1613  typedef enum {
  1614    DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
  1615    DOM_EVENT_CATEGORY_UI = 0x1,
  1616    DOM_EVENT_CATEGORY_MOUSE = 0x2,
  1617    DOM_EVENT_CATEGORY_MUTATION = 0x4,
  1618    DOM_EVENT_CATEGORY_KEYBOARD = 0x8,
  1619    DOM_EVENT_CATEGORY_TEXT = 0x10,
  1620    DOM_EVENT_CATEGORY_COMPOSITION = 0x20,
  1621    DOM_EVENT_CATEGORY_DRAG = 0x40,
  1622    DOM_EVENT_CATEGORY_CLIPBOARD = 0x80,
  1623    DOM_EVENT_CATEGORY_MESSAGE = 0x100,
  1624    DOM_EVENT_CATEGORY_WHEEL = 0x200,
  1625    DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400,
  1626    DOM_EVENT_CATEGORY_OVERFLOW = 0x800,
  1627    DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000,
  1628    DOM_EVENT_CATEGORY_POPSTATE = 0x2000,
  1629    DOM_EVENT_CATEGORY_PROGRESS = 0x4000,
  1630    DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000,
  1631    DOM_EVENT_CATEGORY_BEFORE_LOAD = 0x10000,
  1632  } cef_dom_event_category_t;
  1633  
  1634  ///
  1635  // DOM event processing phases.
  1636  ///
  1637  typedef enum {
  1638    DOM_EVENT_PHASE_UNKNOWN = 0,
  1639    DOM_EVENT_PHASE_CAPTURING,
  1640    DOM_EVENT_PHASE_AT_TARGET,
  1641    DOM_EVENT_PHASE_BUBBLING,
  1642  } cef_dom_event_phase_t;
  1643  
  1644  ///
  1645  // DOM node types.
  1646  ///
  1647  typedef enum {
  1648    DOM_NODE_TYPE_UNSUPPORTED = 0,
  1649    DOM_NODE_TYPE_ELEMENT,
  1650    DOM_NODE_TYPE_ATTRIBUTE,
  1651    DOM_NODE_TYPE_TEXT,
  1652    DOM_NODE_TYPE_CDATA_SECTION,
  1653    DOM_NODE_TYPE_ENTITY,
  1654    DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS,
  1655    DOM_NODE_TYPE_COMMENT,
  1656    DOM_NODE_TYPE_DOCUMENT,
  1657    DOM_NODE_TYPE_DOCUMENT_TYPE,
  1658    DOM_NODE_TYPE_DOCUMENT_FRAGMENT,
  1659    DOM_NODE_TYPE_NOTATION,
  1660    DOM_NODE_TYPE_XPATH_NAMESPACE,
  1661  } cef_dom_node_type_t;
  1662  
  1663  ///
  1664  // Supported file dialog modes.
  1665  ///
  1666  typedef enum {
  1667    ///
  1668    // Requires that the file exists before allowing the user to pick it.
  1669    ///
  1670    FILE_DIALOG_OPEN = 0,
  1671  
  1672    ///
  1673    // Like Open, but allows picking multiple files to open.
  1674    ///
  1675    FILE_DIALOG_OPEN_MULTIPLE,
  1676  
  1677    ///
  1678    // Allows picking a nonexistent file, and prompts to overwrite if the file
  1679    // already exists.
  1680    ///
  1681    FILE_DIALOG_SAVE,
  1682  } cef_file_dialog_mode_t;
  1683  
  1684  ///
  1685  // Geoposition error codes.
  1686  ///
  1687  typedef enum {
  1688    GEOPOSITON_ERROR_NONE = 0,
  1689    GEOPOSITON_ERROR_PERMISSION_DENIED,
  1690    GEOPOSITON_ERROR_POSITION_UNAVAILABLE,
  1691    GEOPOSITON_ERROR_TIMEOUT,
  1692  } cef_geoposition_error_code_t;
  1693  
  1694  ///
  1695  // Structure representing geoposition information. The properties of this
  1696  // structure correspond to those of the JavaScript Position object although
  1697  // their types may differ.
  1698  ///
  1699  typedef struct _cef_geoposition_t {
  1700    ///
  1701    // Latitude in decimal degrees north (WGS84 coordinate frame).
  1702    ///
  1703    double latitude;
  1704  
  1705    ///
  1706    // Longitude in decimal degrees west (WGS84 coordinate frame).
  1707    ///
  1708    double longitude;
  1709  
  1710    ///
  1711    // Altitude in meters (above WGS84 datum).
  1712    ///
  1713    double altitude;
  1714  
  1715    ///
  1716    // Accuracy of horizontal position in meters.
  1717    ///
  1718    double accuracy;
  1719  
  1720    ///
  1721    // Accuracy of altitude in meters.
  1722    ///
  1723    double altitude_accuracy;
  1724  
  1725    ///
  1726    // Heading in decimal degrees clockwise from true north.
  1727    ///
  1728    double heading;
  1729  
  1730    ///
  1731    // Horizontal component of device velocity in meters per second.
  1732    ///
  1733    double speed;
  1734  
  1735    ///
  1736    // Time of position measurement in miliseconds since Epoch in UTC time. This
  1737    // is taken from the host computer's system clock.
  1738    ///
  1739    cef_time_t timestamp;
  1740  
  1741    ///
  1742    // Error code, see enum above.
  1743    ///
  1744    cef_geoposition_error_code_t error_code;
  1745  
  1746    ///
  1747    // Human-readable error message.
  1748    ///
  1749    cef_string_t error_message;
  1750  } cef_geoposition_t;
  1751  
  1752  #ifdef __cplusplus
  1753  }
  1754  #endif
  1755  
  1756  #endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_