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 #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ 31 #define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ 32 #pragma once 33 34 #include "include/base/cef_basictypes.h" 35 #include "include/internal/cef_string.h" 36 #include "include/internal/cef_string_list.h" 37 #include "include/internal/cef_time.h" 38 #include "include/internal/cef_types_geometry.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_MAC) 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 // 32-bit ARGB color value, not premultiplied. The color components are always 50 // in a known order. Equivalent to the SkColor type. 51 typedef uint32 cef_color_t; 52 53 // Return the alpha byte from a cef_color_t value. 54 #define CefColorGetA(color) (((color) >> 24) & 0xFF) 55 // Return the red byte from a cef_color_t value. 56 #define CefColorGetR(color) (((color) >> 16) & 0xFF) 57 // Return the green byte from a cef_color_t value. 58 #define CefColorGetG(color) (((color) >> 8) & 0xFF) 59 // Return the blue byte from a cef_color_t value. 60 #define CefColorGetB(color) (((color) >> 0) & 0xFF) 61 62 // Return an cef_color_t value with the specified byte component values. 63 #define CefColorSetARGB(a, r, g, b) \ 64 static_cast<cef_color_t>( \ 65 (static_cast<unsigned>(a) << 24) | (static_cast<unsigned>(r) << 16) | \ 66 (static_cast<unsigned>(g) << 8) | (static_cast<unsigned>(b) << 0)) 67 68 // Return an int64 value with the specified low and high int32 component values. 69 #define CefInt64Set(int32_low, int32_high) \ 70 static_cast<int64>((static_cast<uint32>(int32_low)) | \ 71 (static_cast<int64>(static_cast<int32>(int32_high))) \ 72 << 32) 73 74 // Return the low int32 value from an int64 value. 75 #define CefInt64GetLow(int64_val) static_cast<int32>(int64_val) 76 // Return the high int32 value from an int64 value. 77 #define CefInt64GetHigh(int64_val) \ 78 static_cast<int32>((static_cast<int64>(int64_val) >> 32) & 0xFFFFFFFFL) 79 80 #ifdef __cplusplus 81 extern "C" { 82 #endif 83 84 /// 85 // Log severity levels. 86 /// 87 typedef enum { 88 /// 89 // Default logging (currently INFO logging). 90 /// 91 LOGSEVERITY_DEFAULT, 92 93 /// 94 // Verbose logging. 95 /// 96 LOGSEVERITY_VERBOSE, 97 98 /// 99 // DEBUG logging. 100 /// 101 LOGSEVERITY_DEBUG = LOGSEVERITY_VERBOSE, 102 103 /// 104 // INFO logging. 105 /// 106 LOGSEVERITY_INFO, 107 108 /// 109 // WARNING logging. 110 /// 111 LOGSEVERITY_WARNING, 112 113 /// 114 // ERROR logging. 115 /// 116 LOGSEVERITY_ERROR, 117 118 /// 119 // FATAL logging. 120 /// 121 LOGSEVERITY_FATAL, 122 123 /// 124 // Disable logging to file for all messages, and to stderr for messages with 125 // severity less than FATAL. 126 /// 127 LOGSEVERITY_DISABLE = 99 128 } cef_log_severity_t; 129 130 /// 131 // Represents the state of a setting. 132 /// 133 typedef enum { 134 /// 135 // Use the default state for the setting. 136 /// 137 STATE_DEFAULT = 0, 138 139 /// 140 // Enable or allow the setting. 141 /// 142 STATE_ENABLED, 143 144 /// 145 // Disable or disallow the setting. 146 /// 147 STATE_DISABLED, 148 } cef_state_t; 149 150 /// 151 // Initialization settings. Specify NULL or 0 to get the recommended default 152 // values. Many of these and other settings can also configured using command- 153 // line switches. 154 /// 155 typedef struct _cef_settings_t { 156 /// 157 // Size of this structure. 158 /// 159 size_t size; 160 161 /// 162 // Set to true (1) to disable the sandbox for sub-processes. See 163 // cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also 164 // configurable using the "no-sandbox" command-line switch. 165 /// 166 int no_sandbox; 167 168 /// 169 // The path to a separate executable that will be launched for sub-processes. 170 // If this value is empty on Windows or Linux then the main process executable 171 // will be used. If this value is empty on macOS then a helper executable must 172 // exist at "Contents/Frameworks/<app> Helper.app/Contents/MacOS/<app> Helper" 173 // in the top-level app bundle. See the comments on CefExecuteProcess() for 174 // details. If this value is non-empty then it must be an absolute path. Also 175 // configurable using the "browser-subprocess-path" command-line switch. 176 /// 177 cef_string_t browser_subprocess_path; 178 179 /// 180 // The path to the CEF framework directory on macOS. If this value is empty 181 // then the framework must exist at "Contents/Frameworks/Chromium Embedded 182 // Framework.framework" in the top-level app bundle. If this value is 183 // non-empty then it must be an absolute path. Also configurable using the 184 // "framework-dir-path" command-line switch. 185 /// 186 cef_string_t framework_dir_path; 187 188 /// 189 // The path to the main bundle on macOS. If this value is empty then it 190 // defaults to the top-level app bundle. If this value is non-empty then it 191 // must be an absolute path. Also configurable using the "main-bundle-path" 192 // command-line switch. 193 /// 194 cef_string_t main_bundle_path; 195 196 /// 197 // Set to true (1) to enable use of the Chrome runtime in CEF. This feature is 198 // considered experimental and is not recommended for most users at this time. 199 // See issue #2969 for details. 200 /// 201 int chrome_runtime; 202 203 /// 204 // Set to true (1) to have the browser process message loop run in a separate 205 // thread. If false (0) then the CefDoMessageLoopWork() function must be 206 // called from your application message loop. This option is only supported on 207 // Windows and Linux. 208 /// 209 int multi_threaded_message_loop; 210 211 /// 212 // Set to true (1) to control browser process main (UI) thread message pump 213 // scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork() 214 // callback. This option is recommended for use in combination with the 215 // CefDoMessageLoopWork() function in cases where the CEF message loop must be 216 // integrated into an existing application message loop (see additional 217 // comments and warnings on CefDoMessageLoopWork). Enabling this option is not 218 // recommended for most users; leave this option disabled and use either the 219 // CefRunMessageLoop() function or multi_threaded_message_loop if possible. 220 /// 221 int external_message_pump; 222 223 /// 224 // Set to true (1) to enable windowless (off-screen) rendering support. Do not 225 // enable this value if the application does not use windowless rendering as 226 // it may reduce rendering performance on some systems. 227 /// 228 int windowless_rendering_enabled; 229 230 /// 231 // Set to true (1) to disable configuration of browser process features using 232 // standard CEF and Chromium command-line arguments. Configuration can still 233 // be specified using CEF data structures or via the 234 // CefApp::OnBeforeCommandLineProcessing() method. 235 /// 236 int command_line_args_disabled; 237 238 /// 239 // The location where data for the global browser cache will be stored on 240 // disk. If this value is non-empty then it must be an absolute path that is 241 // either equal to or a child directory of CefSettings.root_cache_path. If 242 // this value is empty then browsers will be created in "incognito mode" where 243 // in-memory caches are used for storage and no data is persisted to disk. 244 // HTML5 databases such as localStorage will only persist across sessions if a 245 // cache path is specified. Can be overridden for individual CefRequestContext 246 // instances via the CefRequestContextSettings.cache_path value. When using 247 // the Chrome runtime the "default" profile will be used if |cache_path| and 248 // |root_cache_path| have the same value. 249 /// 250 cef_string_t cache_path; 251 252 /// 253 // The root directory that all CefSettings.cache_path and 254 // CefRequestContextSettings.cache_path values must have in common. If this 255 // value is empty and CefSettings.cache_path is non-empty then it will 256 // default to the CefSettings.cache_path value. If this value is non-empty 257 // then it must be an absolute path. Failure to set this value correctly may 258 // result in the sandbox blocking read/write access to the cache_path 259 // directory. 260 /// 261 cef_string_t root_cache_path; 262 263 /// 264 // The location where user data such as the Widevine CDM module and spell 265 // checking dictionary files will be stored on disk. If this value is empty 266 // then the default platform-specific user data directory will be used 267 // ("~/.config/cef_user_data" directory on Linux, "~/Library/Application 268 // Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data" 269 // directory under the user profile directory on Windows). If this value is 270 // non-empty then it must be an absolute path. When using the Chrome runtime 271 // this value will be ignored in favor of the |root_cache_path| value. 272 /// 273 cef_string_t user_data_path; 274 275 /// 276 // To persist session cookies (cookies without an expiry date or validity 277 // interval) by default when using the global cookie manager set this value to 278 // true (1). Session cookies are generally intended to be transient and most 279 // Web browsers do not persist them. A |cache_path| value must also be 280 // specified to enable this feature. Also configurable using the 281 // "persist-session-cookies" command-line switch. Can be overridden for 282 // individual CefRequestContext instances via the 283 // CefRequestContextSettings.persist_session_cookies value. 284 /// 285 int persist_session_cookies; 286 287 /// 288 // To persist user preferences as a JSON file in the cache path directory set 289 // this value to true (1). A |cache_path| value must also be specified 290 // to enable this feature. Also configurable using the 291 // "persist-user-preferences" command-line switch. Can be overridden for 292 // individual CefRequestContext instances via the 293 // CefRequestContextSettings.persist_user_preferences value. 294 /// 295 int persist_user_preferences; 296 297 /// 298 // Value that will be returned as the User-Agent HTTP header. If empty the 299 // default User-Agent string will be used. Also configurable using the 300 // "user-agent" command-line switch. 301 /// 302 cef_string_t user_agent; 303 304 /// 305 // Value that will be inserted as the product portion of the default 306 // User-Agent string. If empty the Chromium product version will be used. If 307 // |userAgent| is specified this value will be ignored. Also configurable 308 // using the "user-agent-product" command-line switch. 309 /// 310 cef_string_t user_agent_product; 311 312 /// 313 // The locale string that will be passed to WebKit. If empty the default 314 // locale of "en-US" will be used. This value is ignored on Linux where locale 315 // is determined using environment variable parsing with the precedence order: 316 // LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang" 317 // command-line switch. 318 /// 319 cef_string_t locale; 320 321 /// 322 // The directory and file name to use for the debug log. If empty a default 323 // log file name and location will be used. On Windows and Linux a "debug.log" 324 // file will be written in the main executable directory. On MacOS a 325 // "~/Library/Logs/<app name>_debug.log" file will be written where <app name> 326 // is the name of the main app executable. Also configurable using the 327 // "log-file" command-line switch. 328 /// 329 cef_string_t log_file; 330 331 /// 332 // The log severity. Only messages of this severity level or higher will be 333 // logged. When set to DISABLE no messages will be written to the log file, 334 // but FATAL messages will still be output to stderr. Also configurable using 335 // the "log-severity" command-line switch with a value of "verbose", "info", 336 // "warning", "error", "fatal" or "disable". 337 /// 338 cef_log_severity_t log_severity; 339 340 /// 341 // Custom flags that will be used when initializing the V8 JavaScript engine. 342 // The consequences of using custom flags may not be well tested. Also 343 // configurable using the "js-flags" command-line switch. 344 /// 345 cef_string_t javascript_flags; 346 347 /// 348 // The fully qualified path for the resources directory. If this value is 349 // empty the *.pak files must be located in the module directory on 350 // Windows/Linux or the app bundle Resources directory on MacOS. If this 351 // value is non-empty then it must be an absolute path. Also configurable 352 // using the "resources-dir-path" command-line switch. 353 /// 354 cef_string_t resources_dir_path; 355 356 /// 357 // The fully qualified path for the locales directory. If this value is empty 358 // the locales directory must be located in the module directory. If this 359 // value is non-empty then it must be an absolute path. This value is ignored 360 // on MacOS where pack files are always loaded from the app bundle Resources 361 // directory. Also configurable using the "locales-dir-path" command-line 362 // switch. 363 /// 364 cef_string_t locales_dir_path; 365 366 /// 367 // Set to true (1) to disable loading of pack files for resources and locales. 368 // A resource bundle handler must be provided for the browser and render 369 // processes via CefApp::GetResourceBundleHandler() if loading of pack files 370 // is disabled. Also configurable using the "disable-pack-loading" command- 371 // line switch. 372 /// 373 int pack_loading_disabled; 374 375 /// 376 // Set to a value between 1024 and 65535 to enable remote debugging on the 377 // specified port. For example, if 8080 is specified the remote debugging URL 378 // will be http://localhost:8080. CEF can be remotely debugged from any CEF or 379 // Chrome browser window. Also configurable using the "remote-debugging-port" 380 // command-line switch. 381 /// 382 int remote_debugging_port; 383 384 /// 385 // The number of stack trace frames to capture for uncaught exceptions. 386 // Specify a positive value to enable the CefRenderProcessHandler:: 387 // OnUncaughtException() callback. Specify 0 (default value) and 388 // OnUncaughtException() will not be called. Also configurable using the 389 // "uncaught-exception-stack-size" command-line switch. 390 /// 391 int uncaught_exception_stack_size; 392 393 /// 394 // Background color used for the browser before a document is loaded and when 395 // no document color is specified. The alpha component must be either fully 396 // opaque (0xFF) or fully transparent (0x00). If the alpha component is fully 397 // opaque then the RGB components will be used as the background color. If the 398 // alpha component is fully transparent for a windowed browser then the 399 // default value of opaque white be used. If the alpha component is fully 400 // transparent for a windowless (off-screen) browser then transparent painting 401 // will be enabled. 402 /// 403 cef_color_t background_color; 404 405 /// 406 // Comma delimited ordered list of language codes without any whitespace that 407 // will be used in the "Accept-Language" HTTP header. May be overridden on a 408 // per-browser basis using the CefBrowserSettings.accept_language_list value. 409 // If both values are empty then "en-US,en" will be used. Can be overridden 410 // for individual CefRequestContext instances via the 411 // CefRequestContextSettings.accept_language_list value. 412 /// 413 cef_string_t accept_language_list; 414 415 /// 416 // Comma delimited list of schemes supported by the associated 417 // CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0) the 418 // default schemes ("http", "https", "ws" and "wss") will also be supported. 419 // Specifying a |cookieable_schemes_list| value and setting 420 // |cookieable_schemes_exclude_defaults| to true (1) will disable all loading 421 // and saving of cookies for this manager. Can be overridden 422 // for individual CefRequestContext instances via the 423 // CefRequestContextSettings.cookieable_schemes_list and 424 // CefRequestContextSettings.cookieable_schemes_exclude_defaults values. 425 /// 426 cef_string_t cookieable_schemes_list; 427 int cookieable_schemes_exclude_defaults; 428 429 /// 430 // GUID string used for identifying the application. This is passed to the 431 // system AV function for scanning downloaded files. By default, the GUID 432 // will be an empty string and the file will be treated as an untrusted 433 // file when the GUID is empty. 434 /// 435 cef_string_t application_client_id_for_file_scanning; 436 } cef_settings_t; 437 438 /// 439 // Request context initialization settings. Specify NULL or 0 to get the 440 // recommended default values. 441 /// 442 typedef struct _cef_request_context_settings_t { 443 /// 444 // Size of this structure. 445 /// 446 size_t size; 447 448 /// 449 // The location where cache data for this request context will be stored on 450 // disk. If this value is non-empty then it must be an absolute path that is 451 // either equal to or a child directory of CefSettings.root_cache_path. If 452 // this value is empty then browsers will be created in "incognito mode" where 453 // in-memory caches are used for storage and no data is persisted to disk. 454 // HTML5 databases such as localStorage will only persist across sessions if a 455 // cache path is specified. To share the global browser cache and related 456 // configuration set this value to match the CefSettings.cache_path value. 457 /// 458 cef_string_t cache_path; 459 460 /// 461 // To persist session cookies (cookies without an expiry date or validity 462 // interval) by default when using the global cookie manager set this value to 463 // true (1). Session cookies are generally intended to be transient and most 464 // Web browsers do not persist them. Can be set globally using the 465 // CefSettings.persist_session_cookies value. This value will be ignored if 466 // |cache_path| is empty or if it matches the CefSettings.cache_path value. 467 /// 468 int persist_session_cookies; 469 470 /// 471 // To persist user preferences as a JSON file in the cache path directory set 472 // this value to true (1). Can be set globally using the 473 // CefSettings.persist_user_preferences value. This value will be ignored if 474 // |cache_path| is empty or if it matches the CefSettings.cache_path value. 475 /// 476 int persist_user_preferences; 477 478 /// 479 // Comma delimited ordered list of language codes without any whitespace that 480 // will be used in the "Accept-Language" HTTP header. Can be set globally 481 // using the CefSettings.accept_language_list value or overridden on a per- 482 // browser basis using the CefBrowserSettings.accept_language_list value. If 483 // all values are empty then "en-US,en" will be used. This value will be 484 // ignored if |cache_path| matches the CefSettings.cache_path value. 485 /// 486 cef_string_t accept_language_list; 487 488 /// 489 // Comma delimited list of schemes supported by the associated 490 // CefCookieManager. If |cookieable_schemes_exclude_defaults| is false (0) the 491 // default schemes ("http", "https", "ws" and "wss") will also be supported. 492 // Specifying a |cookieable_schemes_list| value and setting 493 // |cookieable_schemes_exclude_defaults| to true (1) will disable all loading 494 // and saving of cookies for this manager. These values will be ignored if 495 // |cache_path| matches the CefSettings.cache_path value. 496 /// 497 cef_string_t cookieable_schemes_list; 498 int cookieable_schemes_exclude_defaults; 499 } cef_request_context_settings_t; 500 501 /// 502 // Browser initialization settings. Specify NULL or 0 to get the recommended 503 // default values. The consequences of using custom values may not be well 504 // tested. Many of these and other settings can also configured using command- 505 // line switches. 506 /// 507 typedef struct _cef_browser_settings_t { 508 /// 509 // Size of this structure. 510 /// 511 size_t size; 512 513 /// 514 // The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint 515 // will be called for a windowless browser. The actual fps may be lower if 516 // the browser cannot generate frames at the requested rate. The minimum 517 // value is 1 and the maximum value is 60 (default 30). This value can also be 518 // changed dynamically via CefBrowserHost::SetWindowlessFrameRate. 519 /// 520 int windowless_frame_rate; 521 522 // The below values map to WebPreferences settings. 523 524 /// 525 // Font settings. 526 /// 527 cef_string_t standard_font_family; 528 cef_string_t fixed_font_family; 529 cef_string_t serif_font_family; 530 cef_string_t sans_serif_font_family; 531 cef_string_t cursive_font_family; 532 cef_string_t fantasy_font_family; 533 int default_font_size; 534 int default_fixed_font_size; 535 int minimum_font_size; 536 int minimum_logical_font_size; 537 538 /// 539 // Default encoding for Web content. If empty "ISO-8859-1" will be used. Also 540 // configurable using the "default-encoding" command-line switch. 541 /// 542 cef_string_t default_encoding; 543 544 /// 545 // Controls the loading of fonts from remote sources. Also configurable using 546 // the "disable-remote-fonts" command-line switch. 547 /// 548 cef_state_t remote_fonts; 549 550 /// 551 // Controls whether JavaScript can be executed. Also configurable using the 552 // "disable-javascript" command-line switch. 553 /// 554 cef_state_t javascript; 555 556 /// 557 // Controls whether JavaScript can be used to close windows that were not 558 // opened via JavaScript. JavaScript can still be used to close windows that 559 // were opened via JavaScript or that have no back/forward history. Also 560 // configurable using the "disable-javascript-close-windows" command-line 561 // switch. 562 /// 563 cef_state_t javascript_close_windows; 564 565 /// 566 // Controls whether JavaScript can access the clipboard. Also configurable 567 // using the "disable-javascript-access-clipboard" command-line switch. 568 /// 569 cef_state_t javascript_access_clipboard; 570 571 /// 572 // Controls whether DOM pasting is supported in the editor via 573 // execCommand("paste"). The |javascript_access_clipboard| setting must also 574 // be enabled. Also configurable using the "disable-javascript-dom-paste" 575 // command-line switch. 576 /// 577 cef_state_t javascript_dom_paste; 578 579 /// 580 // Controls whether any plugins will be loaded. Also configurable using the 581 // "disable-plugins" command-line switch. 582 /// 583 cef_state_t plugins; 584 585 /// 586 // Controls whether image URLs will be loaded from the network. A cached image 587 // will still be rendered if requested. Also configurable using the 588 // "disable-image-loading" command-line switch. 589 /// 590 cef_state_t image_loading; 591 592 /// 593 // Controls whether standalone images will be shrunk to fit the page. Also 594 // configurable using the "image-shrink-standalone-to-fit" command-line 595 // switch. 596 /// 597 cef_state_t image_shrink_standalone_to_fit; 598 599 /// 600 // Controls whether text areas can be resized. Also configurable using the 601 // "disable-text-area-resize" command-line switch. 602 /// 603 cef_state_t text_area_resize; 604 605 /// 606 // Controls whether the tab key can advance focus to links. Also configurable 607 // using the "disable-tab-to-links" command-line switch. 608 /// 609 cef_state_t tab_to_links; 610 611 /// 612 // Controls whether local storage can be used. Also configurable using the 613 // "disable-local-storage" command-line switch. 614 /// 615 cef_state_t local_storage; 616 617 /// 618 // Controls whether databases can be used. Also configurable using the 619 // "disable-databases" command-line switch. 620 /// 621 cef_state_t databases; 622 623 /// 624 // Controls whether WebGL can be used. Note that WebGL requires hardware 625 // support and may not work on all systems even when enabled. Also 626 // configurable using the "disable-webgl" command-line switch. 627 /// 628 cef_state_t webgl; 629 630 /// 631 // Background color used for the browser before a document is loaded and when 632 // no document color is specified. The alpha component must be either fully 633 // opaque (0xFF) or fully transparent (0x00). If the alpha component is fully 634 // opaque then the RGB components will be used as the background color. If the 635 // alpha component is fully transparent for a windowed browser then the 636 // CefSettings.background_color value will be used. If the alpha component is 637 // fully transparent for a windowless (off-screen) browser then transparent 638 // painting will be enabled. 639 /// 640 cef_color_t background_color; 641 642 /// 643 // Comma delimited ordered list of language codes without any whitespace that 644 // will be used in the "Accept-Language" HTTP header. May be set globally 645 // using the CefSettings.accept_language_list value. If both values are 646 // empty then "en-US,en" will be used. 647 /// 648 cef_string_t accept_language_list; 649 } cef_browser_settings_t; 650 651 /// 652 // Return value types. 653 /// 654 typedef enum { 655 /// 656 // Cancel immediately. 657 /// 658 RV_CANCEL = 0, 659 660 /// 661 // Continue immediately. 662 /// 663 RV_CONTINUE, 664 665 /// 666 // Continue asynchronously (usually via a callback). 667 /// 668 RV_CONTINUE_ASYNC, 669 } cef_return_value_t; 670 671 /// 672 // URL component parts. 673 /// 674 typedef struct _cef_urlparts_t { 675 /// 676 // The complete URL specification. 677 /// 678 cef_string_t spec; 679 680 /// 681 // Scheme component not including the colon (e.g., "http"). 682 /// 683 cef_string_t scheme; 684 685 /// 686 // User name component. 687 /// 688 cef_string_t username; 689 690 /// 691 // Password component. 692 /// 693 cef_string_t password; 694 695 /// 696 // Host component. This may be a hostname, an IPv4 address or an IPv6 literal 697 // surrounded by square brackets (e.g., "[2001:db8::1]"). 698 /// 699 cef_string_t host; 700 701 /// 702 // Port number component. 703 /// 704 cef_string_t port; 705 706 /// 707 // Origin contains just the scheme, host, and port from a URL. Equivalent to 708 // clearing any username and password, replacing the path with a slash, and 709 // clearing everything after that. This value will be empty for non-standard 710 // URLs. 711 /// 712 cef_string_t origin; 713 714 /// 715 // Path component including the first slash following the host. 716 /// 717 cef_string_t path; 718 719 /// 720 // Query string component (i.e., everything following the '?'). 721 /// 722 cef_string_t query; 723 724 /// 725 // Fragment (hash) identifier component (i.e., the string following the '#'). 726 /// 727 cef_string_t fragment; 728 } cef_urlparts_t; 729 730 /// 731 // Cookie priority values. 732 /// 733 typedef enum { 734 CEF_COOKIE_PRIORITY_LOW = -1, 735 CEF_COOKIE_PRIORITY_MEDIUM = 0, 736 CEF_COOKIE_PRIORITY_HIGH = 1, 737 } cef_cookie_priority_t; 738 739 /// 740 // Cookie same site values. 741 /// 742 typedef enum { 743 CEF_COOKIE_SAME_SITE_UNSPECIFIED, 744 CEF_COOKIE_SAME_SITE_NO_RESTRICTION, 745 CEF_COOKIE_SAME_SITE_LAX_MODE, 746 CEF_COOKIE_SAME_SITE_STRICT_MODE, 747 } cef_cookie_same_site_t; 748 749 /// 750 // Cookie information. 751 /// 752 typedef struct _cef_cookie_t { 753 /// 754 // The cookie name. 755 /// 756 cef_string_t name; 757 758 /// 759 // The cookie value. 760 /// 761 cef_string_t value; 762 763 /// 764 // If |domain| is empty a host cookie will be created instead of a domain 765 // cookie. Domain cookies are stored with a leading "." and are visible to 766 // sub-domains whereas host cookies are not. 767 /// 768 cef_string_t domain; 769 770 /// 771 // If |path| is non-empty only URLs at or below the path will get the cookie 772 // value. 773 /// 774 cef_string_t path; 775 776 /// 777 // If |secure| is true the cookie will only be sent for HTTPS requests. 778 /// 779 int secure; 780 781 /// 782 // If |httponly| is true the cookie will only be sent for HTTP requests. 783 /// 784 int httponly; 785 786 /// 787 // The cookie creation date. This is automatically populated by the system on 788 // cookie creation. 789 /// 790 cef_time_t creation; 791 792 /// 793 // The cookie last access date. This is automatically populated by the system 794 // on access. 795 /// 796 cef_time_t last_access; 797 798 /// 799 // The cookie expiration date is only valid if |has_expires| is true. 800 /// 801 int has_expires; 802 cef_time_t expires; 803 804 /// 805 // Same site. 806 /// 807 cef_cookie_same_site_t same_site; 808 809 /// 810 // Priority. 811 /// 812 cef_cookie_priority_t priority; 813 } cef_cookie_t; 814 815 /// 816 // Process termination status values. 817 /// 818 typedef enum { 819 /// 820 // Non-zero exit status. 821 /// 822 TS_ABNORMAL_TERMINATION, 823 824 /// 825 // SIGKILL or task manager kill. 826 /// 827 TS_PROCESS_WAS_KILLED, 828 829 /// 830 // Segmentation fault. 831 /// 832 TS_PROCESS_CRASHED, 833 834 /// 835 // Out of memory. Some platforms may use TS_PROCESS_CRASHED instead. 836 /// 837 TS_PROCESS_OOM, 838 } cef_termination_status_t; 839 840 /// 841 // Path key values. 842 /// 843 typedef enum { 844 /// 845 // Current directory. 846 /// 847 PK_DIR_CURRENT, 848 849 /// 850 // Directory containing PK_FILE_EXE. 851 /// 852 PK_DIR_EXE, 853 854 /// 855 // Directory containing PK_FILE_MODULE. 856 /// 857 PK_DIR_MODULE, 858 859 /// 860 // Temporary directory. 861 /// 862 PK_DIR_TEMP, 863 864 /// 865 // Path and filename of the current executable. 866 /// 867 PK_FILE_EXE, 868 869 /// 870 // Path and filename of the module containing the CEF code (usually the libcef 871 // module). 872 /// 873 PK_FILE_MODULE, 874 875 /// 876 // "Local Settings\Application Data" directory under the user profile 877 // directory on Windows. 878 /// 879 PK_LOCAL_APP_DATA, 880 881 /// 882 // "Application Data" directory under the user profile directory on Windows 883 // and "~/Library/Application Support" directory on MacOS. 884 /// 885 PK_USER_DATA, 886 887 /// 888 // Directory containing application resources. Can be configured via 889 // CefSettings.resources_dir_path. 890 /// 891 PK_DIR_RESOURCES, 892 } cef_path_key_t; 893 894 /// 895 // Storage types. 896 /// 897 typedef enum { 898 ST_LOCALSTORAGE = 0, 899 ST_SESSIONSTORAGE, 900 } cef_storage_type_t; 901 902 /// 903 // Supported error code values. 904 /// 905 typedef enum { 906 // No error. 907 ERR_NONE = 0, 908 909 #define NET_ERROR(label, value) ERR_##label = value, 910 #include "include/base/internal/cef_net_error_list.h" 911 #undef NET_ERROR 912 913 } cef_errorcode_t; 914 915 /// 916 // Supported certificate status code values. See net\cert\cert_status_flags.h 917 // for more information. CERT_STATUS_NONE is new in CEF because we use an 918 // enum while cert_status_flags.h uses a typedef and static const variables. 919 /// 920 typedef enum { 921 CERT_STATUS_NONE = 0, 922 CERT_STATUS_COMMON_NAME_INVALID = 1 << 0, 923 CERT_STATUS_DATE_INVALID = 1 << 1, 924 CERT_STATUS_AUTHORITY_INVALID = 1 << 2, 925 // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP). 926 CERT_STATUS_NO_REVOCATION_MECHANISM = 1 << 4, 927 CERT_STATUS_UNABLE_TO_CHECK_REVOCATION = 1 << 5, 928 CERT_STATUS_REVOKED = 1 << 6, 929 CERT_STATUS_INVALID = 1 << 7, 930 CERT_STATUS_WEAK_SIGNATURE_ALGORITHM = 1 << 8, 931 // 1 << 9 was used for CERT_STATUS_NOT_IN_DNS 932 CERT_STATUS_NON_UNIQUE_NAME = 1 << 10, 933 CERT_STATUS_WEAK_KEY = 1 << 11, 934 // 1 << 12 was used for CERT_STATUS_WEAK_DH_KEY 935 CERT_STATUS_PINNED_KEY_MISSING = 1 << 13, 936 CERT_STATUS_NAME_CONSTRAINT_VIOLATION = 1 << 14, 937 CERT_STATUS_VALIDITY_TOO_LONG = 1 << 15, 938 939 // Bits 16 to 31 are for non-error statuses. 940 CERT_STATUS_IS_EV = 1 << 16, 941 CERT_STATUS_REV_CHECKING_ENABLED = 1 << 17, 942 // Bit 18 was CERT_STATUS_IS_DNSSEC 943 CERT_STATUS_SHA1_SIGNATURE_PRESENT = 1 << 19, 944 CERT_STATUS_CT_COMPLIANCE_FAILED = 1 << 20, 945 } cef_cert_status_t; 946 947 /// 948 // The manner in which a link click should be opened. These constants match 949 // their equivalents in Chromium's window_open_disposition.h and should not be 950 // renumbered. 951 /// 952 typedef enum { 953 WOD_UNKNOWN, 954 WOD_CURRENT_TAB, 955 WOD_SINGLETON_TAB, 956 WOD_NEW_FOREGROUND_TAB, 957 WOD_NEW_BACKGROUND_TAB, 958 WOD_NEW_POPUP, 959 WOD_NEW_WINDOW, 960 WOD_SAVE_TO_DISK, 961 WOD_OFF_THE_RECORD, 962 WOD_IGNORE_ACTION 963 } cef_window_open_disposition_t; 964 965 /// 966 // "Verb" of a drag-and-drop operation as negotiated between the source and 967 // destination. These constants match their equivalents in WebCore's 968 // DragActions.h and should not be renumbered. 969 /// 970 typedef enum { 971 DRAG_OPERATION_NONE = 0, 972 DRAG_OPERATION_COPY = 1, 973 DRAG_OPERATION_LINK = 2, 974 DRAG_OPERATION_GENERIC = 4, 975 DRAG_OPERATION_PRIVATE = 8, 976 DRAG_OPERATION_MOVE = 16, 977 DRAG_OPERATION_DELETE = 32, 978 DRAG_OPERATION_EVERY = UINT_MAX 979 } cef_drag_operations_mask_t; 980 981 /// 982 // Input mode of a virtual keyboard. These constants match their equivalents 983 // in Chromium's text_input_mode.h and should not be renumbered. 984 // See https://html.spec.whatwg.org/#input-modalities:-the-inputmode-attribute 985 /// 986 typedef enum { 987 CEF_TEXT_INPUT_MODE_DEFAULT, 988 CEF_TEXT_INPUT_MODE_NONE, 989 CEF_TEXT_INPUT_MODE_TEXT, 990 CEF_TEXT_INPUT_MODE_TEL, 991 CEF_TEXT_INPUT_MODE_URL, 992 CEF_TEXT_INPUT_MODE_EMAIL, 993 CEF_TEXT_INPUT_MODE_NUMERIC, 994 CEF_TEXT_INPUT_MODE_DECIMAL, 995 CEF_TEXT_INPUT_MODE_SEARCH, 996 997 CEF_TEXT_INPUT_MODE_MAX = CEF_TEXT_INPUT_MODE_SEARCH, 998 } cef_text_input_mode_t; 999 1000 /// 1001 // V8 access control values. 1002 /// 1003 typedef enum { 1004 V8_ACCESS_CONTROL_DEFAULT = 0, 1005 V8_ACCESS_CONTROL_ALL_CAN_READ = 1, 1006 V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, 1007 V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2 1008 } cef_v8_accesscontrol_t; 1009 1010 /// 1011 // V8 property attribute values. 1012 /// 1013 typedef enum { 1014 V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable, 1015 // Configurable 1016 V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable 1017 V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable 1018 V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable 1019 } cef_v8_propertyattribute_t; 1020 1021 /// 1022 // Post data elements may represent either bytes or files. 1023 /// 1024 typedef enum { 1025 PDE_TYPE_EMPTY = 0, 1026 PDE_TYPE_BYTES, 1027 PDE_TYPE_FILE, 1028 } cef_postdataelement_type_t; 1029 1030 /// 1031 // Resource type for a request. These constants match their equivalents in 1032 // Chromium's ResourceType and should not be renumbered. 1033 /// 1034 typedef enum { 1035 /// 1036 // Top level page. 1037 /// 1038 RT_MAIN_FRAME = 0, 1039 1040 /// 1041 // Frame or iframe. 1042 /// 1043 RT_SUB_FRAME, 1044 1045 /// 1046 // CSS stylesheet. 1047 /// 1048 RT_STYLESHEET, 1049 1050 /// 1051 // External script. 1052 /// 1053 RT_SCRIPT, 1054 1055 /// 1056 // Image (jpg/gif/png/etc). 1057 /// 1058 RT_IMAGE, 1059 1060 /// 1061 // Font. 1062 /// 1063 RT_FONT_RESOURCE, 1064 1065 /// 1066 // Some other subresource. This is the default type if the actual type is 1067 // unknown. 1068 /// 1069 RT_SUB_RESOURCE, 1070 1071 /// 1072 // Object (or embed) tag for a plugin, or a resource that a plugin requested. 1073 /// 1074 RT_OBJECT, 1075 1076 /// 1077 // Media resource. 1078 /// 1079 RT_MEDIA, 1080 1081 /// 1082 // Main resource of a dedicated worker. 1083 /// 1084 RT_WORKER, 1085 1086 /// 1087 // Main resource of a shared worker. 1088 /// 1089 RT_SHARED_WORKER, 1090 1091 /// 1092 // Explicitly requested prefetch. 1093 /// 1094 RT_PREFETCH, 1095 1096 /// 1097 // Favicon. 1098 /// 1099 RT_FAVICON, 1100 1101 /// 1102 // XMLHttpRequest. 1103 /// 1104 RT_XHR, 1105 1106 /// 1107 // A request for a <ping> 1108 /// 1109 RT_PING, 1110 1111 /// 1112 // Main resource of a service worker. 1113 /// 1114 RT_SERVICE_WORKER, 1115 1116 /// 1117 // A report of Content Security Policy violations. 1118 /// 1119 RT_CSP_REPORT, 1120 1121 /// 1122 // A resource that a plugin requested. 1123 /// 1124 RT_PLUGIN_RESOURCE, 1125 1126 /// 1127 // A main-frame service worker navigation preload request. 1128 /// 1129 RT_NAVIGATION_PRELOAD_MAIN_FRAME = 19, 1130 1131 /// 1132 // A sub-frame service worker navigation preload request. 1133 /// 1134 RT_NAVIGATION_PRELOAD_SUB_FRAME, 1135 } cef_resource_type_t; 1136 1137 /// 1138 // Transition type for a request. Made up of one source value and 0 or more 1139 // qualifiers. 1140 /// 1141 typedef enum { 1142 /// 1143 // Source is a link click or the JavaScript window.open function. This is 1144 // also the default value for requests like sub-resource loads that are not 1145 // navigations. 1146 /// 1147 TT_LINK = 0, 1148 1149 /// 1150 // Source is some other "explicit" navigation. This is the default value for 1151 // navigations where the actual type is unknown. See also TT_DIRECT_LOAD_FLAG. 1152 /// 1153 TT_EXPLICIT = 1, 1154 1155 /// 1156 // Source is a subframe navigation. This is any content that is automatically 1157 // loaded in a non-toplevel frame. For example, if a page consists of several 1158 // frames containing ads, those ad URLs will have this transition type. 1159 // The user may not even realize the content in these pages is a separate 1160 // frame, so may not care about the URL. 1161 /// 1162 TT_AUTO_SUBFRAME = 3, 1163 1164 /// 1165 // Source is a subframe navigation explicitly requested by the user that will 1166 // generate new navigation entries in the back/forward list. These are 1167 // probably more important than frames that were automatically loaded in 1168 // the background because the user probably cares about the fact that this 1169 // link was loaded. 1170 /// 1171 TT_MANUAL_SUBFRAME = 4, 1172 1173 /// 1174 // Source is a form submission by the user. NOTE: In some situations 1175 // submitting a form does not result in this transition type. This can happen 1176 // if the form uses a script to submit the contents. 1177 /// 1178 TT_FORM_SUBMIT = 7, 1179 1180 /// 1181 // Source is a "reload" of the page via the Reload function or by re-visiting 1182 // the same URL. NOTE: This is distinct from the concept of whether a 1183 // particular load uses "reload semantics" (i.e. bypasses cached data). 1184 /// 1185 TT_RELOAD = 8, 1186 1187 /// 1188 // General mask defining the bits used for the source values. 1189 /// 1190 TT_SOURCE_MASK = 0xFF, 1191 1192 // Qualifiers. 1193 // Any of the core values above can be augmented by one or more qualifiers. 1194 // These qualifiers further define the transition. 1195 1196 /// 1197 // Attempted to visit a URL but was blocked. 1198 /// 1199 TT_BLOCKED_FLAG = 0x00800000, 1200 1201 /// 1202 // Used the Forward or Back function to navigate among browsing history. 1203 // Will be ORed to the transition type for the original load. 1204 /// 1205 TT_FORWARD_BACK_FLAG = 0x01000000, 1206 1207 /// 1208 // Loaded a URL directly via CreateBrowser, LoadURL or LoadRequest. 1209 /// 1210 TT_DIRECT_LOAD_FLAG = 0x02000000, 1211 1212 /// 1213 // The beginning of a navigation chain. 1214 /// 1215 TT_CHAIN_START_FLAG = 0x10000000, 1216 1217 /// 1218 // The last transition in a redirect chain. 1219 /// 1220 TT_CHAIN_END_FLAG = 0x20000000, 1221 1222 /// 1223 // Redirects caused by JavaScript or a meta refresh tag on the page. 1224 /// 1225 TT_CLIENT_REDIRECT_FLAG = 0x40000000, 1226 1227 /// 1228 // Redirects sent from the server by HTTP headers. 1229 /// 1230 TT_SERVER_REDIRECT_FLAG = 0x80000000, 1231 1232 /// 1233 // Used to test whether a transition involves a redirect. 1234 /// 1235 TT_IS_REDIRECT_MASK = 0xC0000000, 1236 1237 /// 1238 // General mask defining the bits used for the qualifiers. 1239 /// 1240 TT_QUALIFIER_MASK = 0xFFFFFF00, 1241 } cef_transition_type_t; 1242 1243 /// 1244 // Flags used to customize the behavior of CefURLRequest. 1245 /// 1246 typedef enum { 1247 /// 1248 // Default behavior. 1249 /// 1250 UR_FLAG_NONE = 0, 1251 1252 /// 1253 // If set the cache will be skipped when handling the request. Setting this 1254 // value is equivalent to specifying the "Cache-Control: no-cache" request 1255 // header. Setting this value in combination with UR_FLAG_ONLY_FROM_CACHE will 1256 // cause the request to fail. 1257 /// 1258 UR_FLAG_SKIP_CACHE = 1 << 0, 1259 1260 /// 1261 // If set the request will fail if it cannot be served from the cache (or some 1262 // equivalent local store). Setting this value is equivalent to specifying the 1263 // "Cache-Control: only-if-cached" request header. Setting this value in 1264 // combination with UR_FLAG_SKIP_CACHE or UR_FLAG_DISABLE_CACHE will cause the 1265 // request to fail. 1266 /// 1267 UR_FLAG_ONLY_FROM_CACHE = 1 << 1, 1268 1269 /// 1270 // If set the cache will not be used at all. Setting this value is equivalent 1271 // to specifying the "Cache-Control: no-store" request header. Setting this 1272 // value in combination with UR_FLAG_ONLY_FROM_CACHE will cause the request to 1273 // fail. 1274 /// 1275 UR_FLAG_DISABLE_CACHE = 1 << 2, 1276 1277 /// 1278 // If set user name, password, and cookies may be sent with the request, and 1279 // cookies may be saved from the response. 1280 /// 1281 UR_FLAG_ALLOW_STORED_CREDENTIALS = 1 << 3, 1282 1283 /// 1284 // If set upload progress events will be generated when a request has a body. 1285 /// 1286 UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 4, 1287 1288 /// 1289 // If set the CefURLRequestClient::OnDownloadData method will not be called. 1290 /// 1291 UR_FLAG_NO_DOWNLOAD_DATA = 1 << 5, 1292 1293 /// 1294 // If set 5XX redirect errors will be propagated to the observer instead of 1295 // automatically re-tried. This currently only applies for requests 1296 // originated in the browser process. 1297 /// 1298 UR_FLAG_NO_RETRY_ON_5XX = 1 << 6, 1299 1300 /// 1301 // If set 3XX responses will cause the fetch to halt immediately rather than 1302 // continue through the redirect. 1303 /// 1304 UR_FLAG_STOP_ON_REDIRECT = 1 << 7, 1305 } cef_urlrequest_flags_t; 1306 1307 /// 1308 // Flags that represent CefURLRequest status. 1309 /// 1310 typedef enum { 1311 /// 1312 // Unknown status. 1313 /// 1314 UR_UNKNOWN = 0, 1315 1316 /// 1317 // Request succeeded. 1318 /// 1319 UR_SUCCESS, 1320 1321 /// 1322 // An IO request is pending, and the caller will be informed when it is 1323 // completed. 1324 /// 1325 UR_IO_PENDING, 1326 1327 /// 1328 // Request was canceled programatically. 1329 /// 1330 UR_CANCELED, 1331 1332 /// 1333 // Request failed for some reason. 1334 /// 1335 UR_FAILED, 1336 } cef_urlrequest_status_t; 1337 1338 // Structure representing a draggable region. 1339 /// 1340 typedef struct _cef_draggable_region_t { 1341 /// 1342 // Bounds of the region. 1343 /// 1344 cef_rect_t bounds; 1345 1346 /// 1347 // True (1) this this region is draggable and false (0) otherwise. 1348 /// 1349 int draggable; 1350 } cef_draggable_region_t; 1351 1352 /// 1353 // Existing process IDs. 1354 /// 1355 typedef enum { 1356 /// 1357 // Browser process. 1358 /// 1359 PID_BROWSER, 1360 /// 1361 // Renderer process. 1362 /// 1363 PID_RENDERER, 1364 } cef_process_id_t; 1365 1366 /// 1367 // Existing thread IDs. 1368 /// 1369 typedef enum { 1370 // BROWSER PROCESS THREADS -- Only available in the browser process. 1371 1372 /// 1373 // The main thread in the browser. This will be the same as the main 1374 // application thread if CefInitialize() is called with a 1375 // CefSettings.multi_threaded_message_loop value of false. Do not perform 1376 // blocking tasks on this thread. All tasks posted after 1377 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 1378 // are guaranteed to run. This thread will outlive all other CEF threads. 1379 /// 1380 TID_UI, 1381 1382 /// 1383 // Used for blocking tasks (e.g. file system access) where the user won't 1384 // notice if the task takes an arbitrarily long time to complete. All tasks 1385 // posted after CefBrowserProcessHandler::OnContextInitialized() and before 1386 // CefShutdown() are guaranteed to run. 1387 /// 1388 TID_FILE_BACKGROUND, 1389 1390 /// 1391 // Used for blocking tasks (e.g. file system access) that affect UI or 1392 // responsiveness of future user interactions. Do not use if an immediate 1393 // response to a user interaction is expected. All tasks posted after 1394 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 1395 // are guaranteed to run. 1396 // Examples: 1397 // - Updating the UI to reflect progress on a long task. 1398 // - Loading data that might be shown in the UI after a future user 1399 // interaction. 1400 /// 1401 TID_FILE_USER_VISIBLE, 1402 1403 /// 1404 // Used for blocking tasks (e.g. file system access) that affect UI 1405 // immediately after a user interaction. All tasks posted after 1406 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 1407 // are guaranteed to run. 1408 // Example: Generating data shown in the UI immediately after a click. 1409 /// 1410 TID_FILE_USER_BLOCKING, 1411 1412 /// 1413 // Used to launch and terminate browser processes. 1414 /// 1415 TID_PROCESS_LAUNCHER, 1416 1417 /// 1418 // Used to process IPC and network messages. Do not perform blocking tasks on 1419 // this thread. All tasks posted after 1420 // CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown() 1421 // are guaranteed to run. 1422 /// 1423 TID_IO, 1424 1425 // RENDER PROCESS THREADS -- Only available in the render process. 1426 1427 /// 1428 // The main thread in the renderer. Used for all WebKit and V8 interaction. 1429 // Tasks may be posted to this thread after 1430 // CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to 1431 // run before sub-process termination (sub-processes may be killed at any time 1432 // without warning). 1433 /// 1434 TID_RENDERER, 1435 } cef_thread_id_t; 1436 1437 /// 1438 // Thread priority values listed in increasing order of importance. 1439 /// 1440 typedef enum { 1441 /// 1442 // Suitable for threads that shouldn't disrupt high priority work. 1443 /// 1444 TP_BACKGROUND, 1445 1446 /// 1447 // Default priority level. 1448 /// 1449 TP_NORMAL, 1450 1451 /// 1452 // Suitable for threads which generate data for the display (at ~60Hz). 1453 /// 1454 TP_DISPLAY, 1455 1456 /// 1457 // Suitable for low-latency, glitch-resistant audio. 1458 /// 1459 TP_REALTIME_AUDIO, 1460 } cef_thread_priority_t; 1461 1462 /// 1463 // Message loop types. Indicates the set of asynchronous events that a message 1464 // loop can process. 1465 /// 1466 typedef enum { 1467 /// 1468 // Supports tasks and timers. 1469 /// 1470 ML_TYPE_DEFAULT, 1471 1472 /// 1473 // Supports tasks, timers and native UI events (e.g. Windows messages). 1474 /// 1475 ML_TYPE_UI, 1476 1477 /// 1478 // Supports tasks, timers and asynchronous IO events. 1479 /// 1480 ML_TYPE_IO, 1481 } cef_message_loop_type_t; 1482 1483 /// 1484 // Windows COM initialization mode. Specifies how COM will be initialized for a 1485 // new thread. 1486 /// 1487 typedef enum { 1488 /// 1489 // No COM initialization. 1490 /// 1491 COM_INIT_MODE_NONE, 1492 1493 /// 1494 // Initialize COM using single-threaded apartments. 1495 /// 1496 COM_INIT_MODE_STA, 1497 1498 /// 1499 // Initialize COM using multi-threaded apartments. 1500 /// 1501 COM_INIT_MODE_MTA, 1502 } cef_com_init_mode_t; 1503 1504 /// 1505 // Supported value types. 1506 /// 1507 typedef enum { 1508 VTYPE_INVALID = 0, 1509 VTYPE_NULL, 1510 VTYPE_BOOL, 1511 VTYPE_INT, 1512 VTYPE_DOUBLE, 1513 VTYPE_STRING, 1514 VTYPE_BINARY, 1515 VTYPE_DICTIONARY, 1516 VTYPE_LIST, 1517 } cef_value_type_t; 1518 1519 /// 1520 // Supported JavaScript dialog types. 1521 /// 1522 typedef enum { 1523 JSDIALOGTYPE_ALERT = 0, 1524 JSDIALOGTYPE_CONFIRM, 1525 JSDIALOGTYPE_PROMPT, 1526 } cef_jsdialog_type_t; 1527 1528 /// 1529 // Screen information used when window rendering is disabled. This structure is 1530 // passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled 1531 // in by the client. 1532 /// 1533 typedef struct _cef_screen_info_t { 1534 /// 1535 // Device scale factor. Specifies the ratio between physical and logical 1536 // pixels. 1537 /// 1538 float device_scale_factor; 1539 1540 /// 1541 // The screen depth in bits per pixel. 1542 /// 1543 int depth; 1544 1545 /// 1546 // The bits per color component. This assumes that the colors are balanced 1547 // equally. 1548 /// 1549 int depth_per_component; 1550 1551 /// 1552 // This can be true for black and white printers. 1553 /// 1554 int is_monochrome; 1555 1556 /// 1557 // This is set from the rcMonitor member of MONITORINFOEX, to whit: 1558 // "A RECT structure that specifies the display monitor rectangle, 1559 // expressed in virtual-screen coordinates. Note that if the monitor 1560 // is not the primary display monitor, some of the rectangle's 1561 // coordinates may be negative values." 1562 // 1563 // The |rect| and |available_rect| properties are used to determine the 1564 // available surface for rendering popup views. 1565 /// 1566 cef_rect_t rect; 1567 1568 /// 1569 // This is set from the rcWork member of MONITORINFOEX, to whit: 1570 // "A RECT structure that specifies the work area rectangle of the 1571 // display monitor that can be used by applications, expressed in 1572 // virtual-screen coordinates. Windows uses this rectangle to 1573 // maximize an application on the monitor. The rest of the area in 1574 // rcMonitor contains system windows such as the task bar and side 1575 // bars. Note that if the monitor is not the primary display monitor, 1576 // some of the rectangle's coordinates may be negative values". 1577 // 1578 // The |rect| and |available_rect| properties are used to determine the 1579 // available surface for rendering popup views. 1580 /// 1581 cef_rect_t available_rect; 1582 } cef_screen_info_t; 1583 1584 /// 1585 // Supported menu IDs. Non-English translations can be provided for the 1586 // IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString(). 1587 /// 1588 typedef enum { 1589 // Navigation. 1590 MENU_ID_BACK = 100, 1591 MENU_ID_FORWARD = 101, 1592 MENU_ID_RELOAD = 102, 1593 MENU_ID_RELOAD_NOCACHE = 103, 1594 MENU_ID_STOPLOAD = 104, 1595 1596 // Editing. 1597 MENU_ID_UNDO = 110, 1598 MENU_ID_REDO = 111, 1599 MENU_ID_CUT = 112, 1600 MENU_ID_COPY = 113, 1601 MENU_ID_PASTE = 114, 1602 MENU_ID_DELETE = 115, 1603 MENU_ID_SELECT_ALL = 116, 1604 1605 // Miscellaneous. 1606 MENU_ID_FIND = 130, 1607 MENU_ID_PRINT = 131, 1608 MENU_ID_VIEW_SOURCE = 132, 1609 1610 // Spell checking word correction suggestions. 1611 MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, 1612 MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, 1613 MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, 1614 MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, 1615 MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, 1616 MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, 1617 MENU_ID_NO_SPELLING_SUGGESTIONS = 205, 1618 MENU_ID_ADD_TO_DICTIONARY = 206, 1619 1620 // Custom menu items originating from the renderer process. 1621 MENU_ID_CUSTOM_FIRST = 220, 1622 MENU_ID_CUSTOM_LAST = 250, 1623 1624 // All user-defined menu IDs should come between MENU_ID_USER_FIRST and 1625 // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges 1626 // defined in the tools/gritsettings/resource_ids file. 1627 MENU_ID_USER_FIRST = 26500, 1628 MENU_ID_USER_LAST = 28500, 1629 } cef_menu_id_t; 1630 1631 /// 1632 // Mouse button types. 1633 /// 1634 typedef enum { 1635 MBT_LEFT = 0, 1636 MBT_MIDDLE, 1637 MBT_RIGHT, 1638 } cef_mouse_button_type_t; 1639 1640 /// 1641 // Structure representing mouse event information. 1642 /// 1643 typedef struct _cef_mouse_event_t { 1644 /// 1645 // X coordinate relative to the left side of the view. 1646 /// 1647 int x; 1648 1649 /// 1650 // Y coordinate relative to the top side of the view. 1651 /// 1652 int y; 1653 1654 /// 1655 // Bit flags describing any pressed modifier keys. See 1656 // cef_event_flags_t for values. 1657 /// 1658 uint32 modifiers; 1659 } cef_mouse_event_t; 1660 1661 /// 1662 // Touch points states types. 1663 /// 1664 typedef enum { 1665 CEF_TET_RELEASED = 0, 1666 CEF_TET_PRESSED, 1667 CEF_TET_MOVED, 1668 CEF_TET_CANCELLED 1669 } cef_touch_event_type_t; 1670 1671 /// 1672 // The device type that caused the event. 1673 /// 1674 typedef enum { 1675 CEF_POINTER_TYPE_TOUCH = 0, 1676 CEF_POINTER_TYPE_MOUSE, 1677 CEF_POINTER_TYPE_PEN, 1678 CEF_POINTER_TYPE_ERASER, 1679 CEF_POINTER_TYPE_UNKNOWN 1680 } cef_pointer_type_t; 1681 1682 /// 1683 // Structure representing touch event information. 1684 /// 1685 typedef struct _cef_touch_event_t { 1686 /// 1687 // Id of a touch point. Must be unique per touch, can be any number except -1. 1688 // Note that a maximum of 16 concurrent touches will be tracked; touches 1689 // beyond that will be ignored. 1690 /// 1691 int id; 1692 1693 /// 1694 // X coordinate relative to the left side of the view. 1695 /// 1696 float x; 1697 1698 /// 1699 // Y coordinate relative to the top side of the view. 1700 /// 1701 float y; 1702 1703 /// 1704 // X radius in pixels. Set to 0 if not applicable. 1705 /// 1706 float radius_x; 1707 1708 /// 1709 // Y radius in pixels. Set to 0 if not applicable. 1710 /// 1711 float radius_y; 1712 1713 /// 1714 // Rotation angle in radians. Set to 0 if not applicable. 1715 /// 1716 float rotation_angle; 1717 1718 /// 1719 // The normalized pressure of the pointer input in the range of [0,1]. 1720 // Set to 0 if not applicable. 1721 /// 1722 float pressure; 1723 1724 /// 1725 // The state of the touch point. Touches begin with one CEF_TET_PRESSED event 1726 // followed by zero or more CEF_TET_MOVED events and finally one 1727 // CEF_TET_RELEASED or CEF_TET_CANCELLED event. Events not respecting this 1728 // order will be ignored. 1729 /// 1730 cef_touch_event_type_t type; 1731 1732 /// 1733 // Bit flags describing any pressed modifier keys. See 1734 // cef_event_flags_t for values. 1735 /// 1736 uint32 modifiers; 1737 1738 /// 1739 // The device type that caused the event. 1740 /// 1741 cef_pointer_type_t pointer_type; 1742 1743 } cef_touch_event_t; 1744 1745 /// 1746 // Paint element types. 1747 /// 1748 typedef enum { 1749 PET_VIEW = 0, 1750 PET_POPUP, 1751 } cef_paint_element_type_t; 1752 1753 /// 1754 // Supported event bit flags. 1755 /// 1756 typedef enum { 1757 EVENTFLAG_NONE = 0, 1758 EVENTFLAG_CAPS_LOCK_ON = 1 << 0, 1759 EVENTFLAG_SHIFT_DOWN = 1 << 1, 1760 EVENTFLAG_CONTROL_DOWN = 1 << 2, 1761 EVENTFLAG_ALT_DOWN = 1 << 3, 1762 EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, 1763 EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5, 1764 EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, 1765 // Mac OS-X command key. 1766 EVENTFLAG_COMMAND_DOWN = 1 << 7, 1767 EVENTFLAG_NUM_LOCK_ON = 1 << 8, 1768 EVENTFLAG_IS_KEY_PAD = 1 << 9, 1769 EVENTFLAG_IS_LEFT = 1 << 10, 1770 EVENTFLAG_IS_RIGHT = 1 << 11, 1771 EVENTFLAG_ALTGR_DOWN = 1 << 12, 1772 EVENTFLAG_IS_REPEAT = 1 << 13, 1773 } cef_event_flags_t; 1774 1775 /// 1776 // Supported menu item types. 1777 /// 1778 typedef enum { 1779 MENUITEMTYPE_NONE, 1780 MENUITEMTYPE_COMMAND, 1781 MENUITEMTYPE_CHECK, 1782 MENUITEMTYPE_RADIO, 1783 MENUITEMTYPE_SEPARATOR, 1784 MENUITEMTYPE_SUBMENU, 1785 } cef_menu_item_type_t; 1786 1787 /// 1788 // Supported context menu type flags. 1789 /// 1790 typedef enum { 1791 /// 1792 // No node is selected. 1793 /// 1794 CM_TYPEFLAG_NONE = 0, 1795 /// 1796 // The top page is selected. 1797 /// 1798 CM_TYPEFLAG_PAGE = 1 << 0, 1799 /// 1800 // A subframe page is selected. 1801 /// 1802 CM_TYPEFLAG_FRAME = 1 << 1, 1803 /// 1804 // A link is selected. 1805 /// 1806 CM_TYPEFLAG_LINK = 1 << 2, 1807 /// 1808 // A media node is selected. 1809 /// 1810 CM_TYPEFLAG_MEDIA = 1 << 3, 1811 /// 1812 // There is a textual or mixed selection that is selected. 1813 /// 1814 CM_TYPEFLAG_SELECTION = 1 << 4, 1815 /// 1816 // An editable element is selected. 1817 /// 1818 CM_TYPEFLAG_EDITABLE = 1 << 5, 1819 } cef_context_menu_type_flags_t; 1820 1821 /// 1822 // Supported context menu media types. These constants match their equivalents 1823 // in Chromium's ContextMenuDataMediaType and should not be renumbered. 1824 /// 1825 typedef enum { 1826 /// 1827 // No special node is in context. 1828 /// 1829 CM_MEDIATYPE_NONE, 1830 /// 1831 // An image node is selected. 1832 /// 1833 CM_MEDIATYPE_IMAGE, 1834 /// 1835 // A video node is selected. 1836 /// 1837 CM_MEDIATYPE_VIDEO, 1838 /// 1839 // An audio node is selected. 1840 /// 1841 CM_MEDIATYPE_AUDIO, 1842 /// 1843 // An canvas node is selected. 1844 /// 1845 CM_MEDIATYPE_CANVAS, 1846 /// 1847 // A file node is selected. 1848 /// 1849 CM_MEDIATYPE_FILE, 1850 /// 1851 // A plugin node is selected. 1852 /// 1853 CM_MEDIATYPE_PLUGIN, 1854 } cef_context_menu_media_type_t; 1855 1856 /// 1857 // Supported context menu media state bit flags. These constants match their 1858 // equivalents in Chromium's ContextMenuData::MediaFlags and should not be 1859 // renumbered. 1860 /// 1861 typedef enum { 1862 CM_MEDIAFLAG_NONE = 0, 1863 CM_MEDIAFLAG_IN_ERROR = 1 << 0, 1864 CM_MEDIAFLAG_PAUSED = 1 << 1, 1865 CM_MEDIAFLAG_MUTED = 1 << 2, 1866 CM_MEDIAFLAG_LOOP = 1 << 3, 1867 CM_MEDIAFLAG_CAN_SAVE = 1 << 4, 1868 CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, 1869 CM_MEDIAFLAG_CAN_TOGGLE_CONTROLS = 1 << 6, 1870 CM_MEDIAFLAG_CONTROLS = 1 << 7, 1871 CM_MEDIAFLAG_CAN_PRINT = 1 << 8, 1872 CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, 1873 CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10, 1874 CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11, 1875 CM_MEDIAFLAG_CAN_LOOP = 1 << 12, 1876 } cef_context_menu_media_state_flags_t; 1877 1878 /// 1879 // Supported context menu edit state bit flags. These constants match their 1880 // equivalents in Chromium's ContextMenuDataEditFlags and should not be 1881 // renumbered. 1882 /// 1883 typedef enum { 1884 CM_EDITFLAG_NONE = 0, 1885 CM_EDITFLAG_CAN_UNDO = 1 << 0, 1886 CM_EDITFLAG_CAN_REDO = 1 << 1, 1887 CM_EDITFLAG_CAN_CUT = 1 << 2, 1888 CM_EDITFLAG_CAN_COPY = 1 << 3, 1889 CM_EDITFLAG_CAN_PASTE = 1 << 4, 1890 CM_EDITFLAG_CAN_DELETE = 1 << 5, 1891 CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, 1892 CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, 1893 CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8, 1894 } cef_context_menu_edit_state_flags_t; 1895 1896 /// 1897 // Key event types. 1898 /// 1899 typedef enum { 1900 /// 1901 // Notification that a key transitioned from "up" to "down". 1902 /// 1903 KEYEVENT_RAWKEYDOWN = 0, 1904 1905 /// 1906 // Notification that a key was pressed. This does not necessarily correspond 1907 // to a character depending on the key and language. Use KEYEVENT_CHAR for 1908 // character input. 1909 /// 1910 KEYEVENT_KEYDOWN, 1911 1912 /// 1913 // Notification that a key was released. 1914 /// 1915 KEYEVENT_KEYUP, 1916 1917 /// 1918 // Notification that a character was typed. Use this for text input. Key 1919 // down events may generate 0, 1, or more than one character event depending 1920 // on the key, locale, and operating system. 1921 /// 1922 KEYEVENT_CHAR 1923 } cef_key_event_type_t; 1924 1925 /// 1926 // Structure representing keyboard event information. 1927 /// 1928 typedef struct _cef_key_event_t { 1929 /// 1930 // The type of keyboard event. 1931 /// 1932 cef_key_event_type_t type; 1933 1934 /// 1935 // Bit flags describing any pressed modifier keys. See 1936 // cef_event_flags_t for values. 1937 /// 1938 uint32 modifiers; 1939 1940 /// 1941 // The Windows key code for the key event. This value is used by the DOM 1942 // specification. Sometimes it comes directly from the event (i.e. on 1943 // Windows) and sometimes it's determined using a mapping function. See 1944 // WebCore/platform/chromium/KeyboardCodes.h for the list of values. 1945 /// 1946 int windows_key_code; 1947 1948 /// 1949 // The actual key code genenerated by the platform. 1950 /// 1951 int native_key_code; 1952 1953 /// 1954 // Indicates whether the event is considered a "system key" event (see 1955 // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details). 1956 // This value will always be false on non-Windows platforms. 1957 /// 1958 int is_system_key; 1959 1960 /// 1961 // The character generated by the keystroke. 1962 /// 1963 char16 character; 1964 1965 /// 1966 // Same as |character| but unmodified by any concurrently-held modifiers 1967 // (except shift). This is useful for working out shortcut keys. 1968 /// 1969 char16 unmodified_character; 1970 1971 /// 1972 // True if the focus is currently on an editable field on the page. This is 1973 // useful for determining if standard key events should be intercepted. 1974 /// 1975 int focus_on_editable_field; 1976 } cef_key_event_t; 1977 1978 /// 1979 // Focus sources. 1980 /// 1981 typedef enum { 1982 /// 1983 // The source is explicit navigation via the API (LoadURL(), etc). 1984 /// 1985 FOCUS_SOURCE_NAVIGATION = 0, 1986 /// 1987 // The source is a system-generated focus event. 1988 /// 1989 FOCUS_SOURCE_SYSTEM, 1990 } cef_focus_source_t; 1991 1992 /// 1993 // Navigation types. 1994 /// 1995 typedef enum { 1996 NAVIGATION_LINK_CLICKED = 0, 1997 NAVIGATION_FORM_SUBMITTED, 1998 NAVIGATION_BACK_FORWARD, 1999 NAVIGATION_RELOAD, 2000 NAVIGATION_FORM_RESUBMITTED, 2001 NAVIGATION_OTHER, 2002 } cef_navigation_type_t; 2003 2004 /// 2005 // Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and 2006 // UTF16 (LE and BE) by default. All other types must be translated to UTF8 2007 // before being passed to the parser. If a BOM is detected and the correct 2008 // decoder is available then that decoder will be used automatically. 2009 /// 2010 typedef enum { 2011 XML_ENCODING_NONE = 0, 2012 XML_ENCODING_UTF8, 2013 XML_ENCODING_UTF16LE, 2014 XML_ENCODING_UTF16BE, 2015 XML_ENCODING_ASCII, 2016 } cef_xml_encoding_type_t; 2017 2018 /// 2019 // XML node types. 2020 /// 2021 typedef enum { 2022 XML_NODE_UNSUPPORTED = 0, 2023 XML_NODE_PROCESSING_INSTRUCTION, 2024 XML_NODE_DOCUMENT_TYPE, 2025 XML_NODE_ELEMENT_START, 2026 XML_NODE_ELEMENT_END, 2027 XML_NODE_ATTRIBUTE, 2028 XML_NODE_TEXT, 2029 XML_NODE_CDATA, 2030 XML_NODE_ENTITY_REFERENCE, 2031 XML_NODE_WHITESPACE, 2032 XML_NODE_COMMENT, 2033 } cef_xml_node_type_t; 2034 2035 /// 2036 // Popup window features. 2037 /// 2038 typedef struct _cef_popup_features_t { 2039 int x; 2040 int xSet; 2041 int y; 2042 int ySet; 2043 int width; 2044 int widthSet; 2045 int height; 2046 int heightSet; 2047 2048 int menuBarVisible; 2049 int statusBarVisible; 2050 int toolBarVisible; 2051 int scrollbarsVisible; 2052 } cef_popup_features_t; 2053 2054 /// 2055 // DOM document types. 2056 /// 2057 typedef enum { 2058 DOM_DOCUMENT_TYPE_UNKNOWN = 0, 2059 DOM_DOCUMENT_TYPE_HTML, 2060 DOM_DOCUMENT_TYPE_XHTML, 2061 DOM_DOCUMENT_TYPE_PLUGIN, 2062 } cef_dom_document_type_t; 2063 2064 /// 2065 // DOM event category flags. 2066 /// 2067 typedef enum { 2068 DOM_EVENT_CATEGORY_UNKNOWN = 0x0, 2069 DOM_EVENT_CATEGORY_UI = 0x1, 2070 DOM_EVENT_CATEGORY_MOUSE = 0x2, 2071 DOM_EVENT_CATEGORY_MUTATION = 0x4, 2072 DOM_EVENT_CATEGORY_KEYBOARD = 0x8, 2073 DOM_EVENT_CATEGORY_TEXT = 0x10, 2074 DOM_EVENT_CATEGORY_COMPOSITION = 0x20, 2075 DOM_EVENT_CATEGORY_DRAG = 0x40, 2076 DOM_EVENT_CATEGORY_CLIPBOARD = 0x80, 2077 DOM_EVENT_CATEGORY_MESSAGE = 0x100, 2078 DOM_EVENT_CATEGORY_WHEEL = 0x200, 2079 DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400, 2080 DOM_EVENT_CATEGORY_OVERFLOW = 0x800, 2081 DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000, 2082 DOM_EVENT_CATEGORY_POPSTATE = 0x2000, 2083 DOM_EVENT_CATEGORY_PROGRESS = 0x4000, 2084 DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000, 2085 } cef_dom_event_category_t; 2086 2087 /// 2088 // DOM event processing phases. 2089 /// 2090 typedef enum { 2091 DOM_EVENT_PHASE_UNKNOWN = 0, 2092 DOM_EVENT_PHASE_CAPTURING, 2093 DOM_EVENT_PHASE_AT_TARGET, 2094 DOM_EVENT_PHASE_BUBBLING, 2095 } cef_dom_event_phase_t; 2096 2097 /// 2098 // DOM node types. 2099 /// 2100 typedef enum { 2101 DOM_NODE_TYPE_UNSUPPORTED = 0, 2102 DOM_NODE_TYPE_ELEMENT, 2103 DOM_NODE_TYPE_ATTRIBUTE, 2104 DOM_NODE_TYPE_TEXT, 2105 DOM_NODE_TYPE_CDATA_SECTION, 2106 DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS, 2107 DOM_NODE_TYPE_COMMENT, 2108 DOM_NODE_TYPE_DOCUMENT, 2109 DOM_NODE_TYPE_DOCUMENT_TYPE, 2110 DOM_NODE_TYPE_DOCUMENT_FRAGMENT, 2111 } cef_dom_node_type_t; 2112 2113 /// 2114 // Supported file dialog modes. 2115 /// 2116 typedef enum { 2117 /// 2118 // Requires that the file exists before allowing the user to pick it. 2119 /// 2120 FILE_DIALOG_OPEN = 0, 2121 2122 /// 2123 // Like Open, but allows picking multiple files to open. 2124 /// 2125 FILE_DIALOG_OPEN_MULTIPLE, 2126 2127 /// 2128 // Like Open, but selects a folder to open. 2129 /// 2130 FILE_DIALOG_OPEN_FOLDER, 2131 2132 /// 2133 // Allows picking a nonexistent file, and prompts to overwrite if the file 2134 // already exists. 2135 /// 2136 FILE_DIALOG_SAVE, 2137 2138 /// 2139 // General mask defining the bits used for the type values. 2140 /// 2141 FILE_DIALOG_TYPE_MASK = 0xFF, 2142 2143 // Qualifiers. 2144 // Any of the type values above can be augmented by one or more qualifiers. 2145 // These qualifiers further define the dialog behavior. 2146 2147 /// 2148 // Prompt to overwrite if the user selects an existing file with the Save 2149 // dialog. 2150 /// 2151 FILE_DIALOG_OVERWRITEPROMPT_FLAG = 0x01000000, 2152 2153 /// 2154 // Do not display read-only files. 2155 /// 2156 FILE_DIALOG_HIDEREADONLY_FLAG = 0x02000000, 2157 } cef_file_dialog_mode_t; 2158 2159 /// 2160 // Print job color mode values. 2161 /// 2162 typedef enum { 2163 COLOR_MODEL_UNKNOWN, 2164 COLOR_MODEL_GRAY, 2165 COLOR_MODEL_COLOR, 2166 COLOR_MODEL_CMYK, 2167 COLOR_MODEL_CMY, 2168 COLOR_MODEL_KCMY, 2169 COLOR_MODEL_CMY_K, // CMY_K represents CMY+K. 2170 COLOR_MODEL_BLACK, 2171 COLOR_MODEL_GRAYSCALE, 2172 COLOR_MODEL_RGB, 2173 COLOR_MODEL_RGB16, 2174 COLOR_MODEL_RGBA, 2175 COLOR_MODEL_COLORMODE_COLOR, // Used in samsung printer ppds. 2176 COLOR_MODEL_COLORMODE_MONOCHROME, // Used in samsung printer ppds. 2177 COLOR_MODEL_HP_COLOR_COLOR, // Used in HP color printer ppds. 2178 COLOR_MODEL_HP_COLOR_BLACK, // Used in HP color printer ppds. 2179 COLOR_MODEL_PRINTOUTMODE_NORMAL, // Used in foomatic ppds. 2180 COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY, // Used in foomatic ppds. 2181 COLOR_MODEL_PROCESSCOLORMODEL_CMYK, // Used in canon printer ppds. 2182 COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE, // Used in canon printer ppds. 2183 COLOR_MODEL_PROCESSCOLORMODEL_RGB, // Used in canon printer ppds 2184 } cef_color_model_t; 2185 2186 /// 2187 // Print job duplex mode values. 2188 /// 2189 typedef enum { 2190 DUPLEX_MODE_UNKNOWN = -1, 2191 DUPLEX_MODE_SIMPLEX, 2192 DUPLEX_MODE_LONG_EDGE, 2193 DUPLEX_MODE_SHORT_EDGE, 2194 } cef_duplex_mode_t; 2195 2196 /// 2197 // Cursor type values. 2198 /// 2199 typedef enum { 2200 CT_POINTER = 0, 2201 CT_CROSS, 2202 CT_HAND, 2203 CT_IBEAM, 2204 CT_WAIT, 2205 CT_HELP, 2206 CT_EASTRESIZE, 2207 CT_NORTHRESIZE, 2208 CT_NORTHEASTRESIZE, 2209 CT_NORTHWESTRESIZE, 2210 CT_SOUTHRESIZE, 2211 CT_SOUTHEASTRESIZE, 2212 CT_SOUTHWESTRESIZE, 2213 CT_WESTRESIZE, 2214 CT_NORTHSOUTHRESIZE, 2215 CT_EASTWESTRESIZE, 2216 CT_NORTHEASTSOUTHWESTRESIZE, 2217 CT_NORTHWESTSOUTHEASTRESIZE, 2218 CT_COLUMNRESIZE, 2219 CT_ROWRESIZE, 2220 CT_MIDDLEPANNING, 2221 CT_EASTPANNING, 2222 CT_NORTHPANNING, 2223 CT_NORTHEASTPANNING, 2224 CT_NORTHWESTPANNING, 2225 CT_SOUTHPANNING, 2226 CT_SOUTHEASTPANNING, 2227 CT_SOUTHWESTPANNING, 2228 CT_WESTPANNING, 2229 CT_MOVE, 2230 CT_VERTICALTEXT, 2231 CT_CELL, 2232 CT_CONTEXTMENU, 2233 CT_ALIAS, 2234 CT_PROGRESS, 2235 CT_NODROP, 2236 CT_COPY, 2237 CT_NONE, 2238 CT_NOTALLOWED, 2239 CT_ZOOMIN, 2240 CT_ZOOMOUT, 2241 CT_GRAB, 2242 CT_GRABBING, 2243 CT_MIDDLE_PANNING_VERTICAL, 2244 CT_MIDDLE_PANNING_HORIZONTAL, 2245 CT_CUSTOM, 2246 CT_DND_NONE, 2247 CT_DND_MOVE, 2248 CT_DND_COPY, 2249 CT_DND_LINK, 2250 } cef_cursor_type_t; 2251 2252 /// 2253 // Structure representing cursor information. |buffer| will be 2254 // |size.width|*|size.height|*4 bytes in size and represents a BGRA image with 2255 // an upper-left origin. 2256 /// 2257 typedef struct _cef_cursor_info_t { 2258 cef_point_t hotspot; 2259 float image_scale_factor; 2260 void* buffer; 2261 cef_size_t size; 2262 } cef_cursor_info_t; 2263 2264 /// 2265 // URI unescape rules passed to CefURIDecode(). 2266 /// 2267 typedef enum { 2268 /// 2269 // Don't unescape anything at all. 2270 /// 2271 UU_NONE = 0, 2272 2273 /// 2274 // Don't unescape anything special, but all normal unescaping will happen. 2275 // This is a placeholder and can't be combined with other flags (since it's 2276 // just the absence of them). All other unescape rules imply "normal" in 2277 // addition to their special meaning. Things like escaped letters, digits, 2278 // and most symbols will get unescaped with this mode. 2279 /// 2280 UU_NORMAL = 1 << 0, 2281 2282 /// 2283 // Convert %20 to spaces. In some places where we're showing URLs, we may 2284 // want this. In places where the URL may be copied and pasted out, then 2285 // you wouldn't want this since it might not be interpreted in one piece 2286 // by other applications. 2287 /// 2288 UU_SPACES = 1 << 1, 2289 2290 /// 2291 // Unescapes '/' and '\\'. If these characters were unescaped, the resulting 2292 // URL won't be the same as the source one. Moreover, they are dangerous to 2293 // unescape in strings that will be used as file paths or names. This value 2294 // should only be used when slashes don't have special meaning, like data 2295 // URLs. 2296 /// 2297 UU_PATH_SEPARATORS = 1 << 2, 2298 2299 /// 2300 // Unescapes various characters that will change the meaning of URLs, 2301 // including '%', '+', '&', '#'. Does not unescape path separators. 2302 // If these characters were unescaped, the resulting URL won't be the same 2303 // as the source one. This flag is used when generating final output like 2304 // filenames for URLs where we won't be interpreting as a URL and want to do 2305 // as much unescaping as possible. 2306 /// 2307 UU_URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS = 1 << 3, 2308 2309 /// 2310 // URL queries use "+" for space. This flag controls that replacement. 2311 /// 2312 UU_REPLACE_PLUS_WITH_SPACE = 1 << 4, 2313 } cef_uri_unescape_rule_t; 2314 2315 /// 2316 // Options that can be passed to CefParseJSON. 2317 /// 2318 typedef enum { 2319 /// 2320 // Parses the input strictly according to RFC 4627. See comments in Chromium's 2321 // base/json/json_reader.h file for known limitations/deviations from the RFC. 2322 /// 2323 JSON_PARSER_RFC = 0, 2324 2325 /// 2326 // Allows commas to exist after the last element in structures. 2327 /// 2328 JSON_PARSER_ALLOW_TRAILING_COMMAS = 1 << 0, 2329 } cef_json_parser_options_t; 2330 2331 /// 2332 // Options that can be passed to CefWriteJSON. 2333 /// 2334 typedef enum { 2335 /// 2336 // Default behavior. 2337 /// 2338 JSON_WRITER_DEFAULT = 0, 2339 2340 /// 2341 // This option instructs the writer that if a Binary value is encountered, 2342 // the value (and key if within a dictionary) will be omitted from the 2343 // output, and success will be returned. Otherwise, if a binary value is 2344 // encountered, failure will be returned. 2345 /// 2346 JSON_WRITER_OMIT_BINARY_VALUES = 1 << 0, 2347 2348 /// 2349 // This option instructs the writer to write doubles that have no fractional 2350 // part as a normal integer (i.e., without using exponential notation 2351 // or appending a '.0') as long as the value is within the range of a 2352 // 64-bit int. 2353 /// 2354 JSON_WRITER_OMIT_DOUBLE_TYPE_PRESERVATION = 1 << 1, 2355 2356 /// 2357 // Return a slightly nicer formatted json string (pads with whitespace to 2358 // help with readability). 2359 /// 2360 JSON_WRITER_PRETTY_PRINT = 1 << 2, 2361 } cef_json_writer_options_t; 2362 2363 /// 2364 // Margin type for PDF printing. 2365 /// 2366 typedef enum { 2367 /// 2368 // Default margins. 2369 /// 2370 PDF_PRINT_MARGIN_DEFAULT, 2371 2372 /// 2373 // No margins. 2374 /// 2375 PDF_PRINT_MARGIN_NONE, 2376 2377 /// 2378 // Minimum margins. 2379 /// 2380 PDF_PRINT_MARGIN_MINIMUM, 2381 2382 /// 2383 // Custom margins using the |margin_*| values from cef_pdf_print_settings_t. 2384 /// 2385 PDF_PRINT_MARGIN_CUSTOM, 2386 } cef_pdf_print_margin_type_t; 2387 2388 /// 2389 // Structure representing PDF print settings. 2390 /// 2391 typedef struct _cef_pdf_print_settings_t { 2392 /// 2393 // Page title to display in the header. Only used if |header_footer_enabled| 2394 // is set to true (1). 2395 /// 2396 cef_string_t header_footer_title; 2397 2398 /// 2399 // URL to display in the footer. Only used if |header_footer_enabled| is set 2400 // to true (1). 2401 /// 2402 cef_string_t header_footer_url; 2403 2404 /// 2405 // Output page size in microns. If either of these values is less than or 2406 // equal to zero then the default paper size (A4) will be used. 2407 /// 2408 int page_width; 2409 int page_height; 2410 2411 /// 2412 // The percentage to scale the PDF by before printing (e.g. 50 is 50%). 2413 // If this value is less than or equal to zero the default value of 100 2414 // will be used. 2415 /// 2416 int scale_factor; 2417 2418 /// 2419 // Margins in points. Only used if |margin_type| is set to 2420 // PDF_PRINT_MARGIN_CUSTOM. 2421 /// 2422 int margin_top; 2423 int margin_right; 2424 int margin_bottom; 2425 int margin_left; 2426 2427 /// 2428 // Margin type. 2429 /// 2430 cef_pdf_print_margin_type_t margin_type; 2431 2432 /// 2433 // Set to true (1) to print headers and footers or false (0) to not print 2434 // headers and footers. 2435 /// 2436 int header_footer_enabled; 2437 2438 /// 2439 // Set to true (1) to print the selection only or false (0) to print all. 2440 /// 2441 int selection_only; 2442 2443 /// 2444 // Set to true (1) for landscape mode or false (0) for portrait mode. 2445 /// 2446 int landscape; 2447 2448 /// 2449 // Set to true (1) to print background graphics or false (0) to not print 2450 // background graphics. 2451 /// 2452 int backgrounds_enabled; 2453 2454 } cef_pdf_print_settings_t; 2455 2456 /// 2457 // Supported UI scale factors for the platform. SCALE_FACTOR_NONE is used for 2458 // density independent resources such as string, html/js files or an image that 2459 // can be used for any scale factors (such as wallpapers). 2460 /// 2461 typedef enum { 2462 SCALE_FACTOR_NONE = 0, 2463 SCALE_FACTOR_100P, 2464 SCALE_FACTOR_125P, 2465 SCALE_FACTOR_133P, 2466 SCALE_FACTOR_140P, 2467 SCALE_FACTOR_150P, 2468 SCALE_FACTOR_180P, 2469 SCALE_FACTOR_200P, 2470 SCALE_FACTOR_250P, 2471 SCALE_FACTOR_300P, 2472 } cef_scale_factor_t; 2473 2474 /// 2475 // Plugin policies supported by CefRequestContextHandler::OnBeforePluginLoad. 2476 /// 2477 typedef enum { 2478 /// 2479 // Allow the content. 2480 /// 2481 PLUGIN_POLICY_ALLOW, 2482 2483 /// 2484 // Allow important content and block unimportant content based on heuristics. 2485 // The user can manually load blocked content. 2486 /// 2487 PLUGIN_POLICY_DETECT_IMPORTANT, 2488 2489 /// 2490 // Block the content. The user can manually load blocked content. 2491 /// 2492 PLUGIN_POLICY_BLOCK, 2493 2494 /// 2495 // Disable the content. The user cannot load disabled content. 2496 /// 2497 PLUGIN_POLICY_DISABLE, 2498 } cef_plugin_policy_t; 2499 2500 /// 2501 // Policy for how the Referrer HTTP header value will be sent during navigation. 2502 // If the `--no-referrers` command-line flag is specified then the policy value 2503 // will be ignored and the Referrer value will never be sent. 2504 // Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium. 2505 /// 2506 typedef enum { 2507 /// 2508 // Clear the referrer header if the header value is HTTPS but the request 2509 // destination is HTTP. This is the default behavior. 2510 /// 2511 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 2512 REFERRER_POLICY_DEFAULT = 2513 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 2514 2515 /// 2516 // A slight variant on CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: 2517 // If the request destination is HTTP, an HTTPS referrer will be cleared. If 2518 // the request's destination is cross-origin with the referrer (but does not 2519 // downgrade), the referrer's granularity will be stripped down to an origin 2520 // rather than a full URL. Same-origin requests will send the full referrer. 2521 /// 2522 REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN, 2523 2524 /// 2525 // Strip the referrer down to an origin when the origin of the referrer is 2526 // different from the destination's origin. 2527 /// 2528 REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN, 2529 2530 /// 2531 // Never change the referrer. 2532 /// 2533 REFERRER_POLICY_NEVER_CLEAR_REFERRER, 2534 2535 /// 2536 // Strip the referrer down to the origin regardless of the redirect location. 2537 /// 2538 REFERRER_POLICY_ORIGIN, 2539 2540 /// 2541 // Clear the referrer when the request's referrer is cross-origin with the 2542 // request's destination. 2543 /// 2544 REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN, 2545 2546 /// 2547 // Strip the referrer down to the origin, but clear it entirely if the 2548 // referrer value is HTTPS and the destination is HTTP. 2549 /// 2550 REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 2551 2552 /// 2553 // Always clear the referrer regardless of the request destination. 2554 /// 2555 REFERRER_POLICY_NO_REFERRER, 2556 2557 // Always the last value in this enumeration. 2558 REFERRER_POLICY_LAST_VALUE = REFERRER_POLICY_NO_REFERRER, 2559 } cef_referrer_policy_t; 2560 2561 /// 2562 // Return values for CefResponseFilter::Filter(). 2563 /// 2564 typedef enum { 2565 /// 2566 // Some or all of the pre-filter data was read successfully but more data is 2567 // needed in order to continue filtering (filtered output is pending). 2568 /// 2569 RESPONSE_FILTER_NEED_MORE_DATA, 2570 2571 /// 2572 // Some or all of the pre-filter data was read successfully and all available 2573 // filtered output has been written. 2574 /// 2575 RESPONSE_FILTER_DONE, 2576 2577 /// 2578 // An error occurred during filtering. 2579 /// 2580 RESPONSE_FILTER_ERROR 2581 } cef_response_filter_status_t; 2582 2583 /// 2584 // Describes how to interpret the components of a pixel. 2585 /// 2586 typedef enum { 2587 /// 2588 // RGBA with 8 bits per pixel (32bits total). 2589 /// 2590 CEF_COLOR_TYPE_RGBA_8888, 2591 2592 /// 2593 // BGRA with 8 bits per pixel (32bits total). 2594 /// 2595 CEF_COLOR_TYPE_BGRA_8888, 2596 } cef_color_type_t; 2597 2598 /// 2599 // Describes how to interpret the alpha component of a pixel. 2600 /// 2601 typedef enum { 2602 /// 2603 // No transparency. The alpha component is ignored. 2604 /// 2605 CEF_ALPHA_TYPE_OPAQUE, 2606 2607 /// 2608 // Transparency with pre-multiplied alpha component. 2609 /// 2610 CEF_ALPHA_TYPE_PREMULTIPLIED, 2611 2612 /// 2613 // Transparency with post-multiplied alpha component. 2614 /// 2615 CEF_ALPHA_TYPE_POSTMULTIPLIED, 2616 } cef_alpha_type_t; 2617 2618 /// 2619 // Text style types. Should be kepy in sync with gfx::TextStyle. 2620 /// 2621 typedef enum { 2622 CEF_TEXT_STYLE_BOLD, 2623 CEF_TEXT_STYLE_ITALIC, 2624 CEF_TEXT_STYLE_STRIKE, 2625 CEF_TEXT_STYLE_DIAGONAL_STRIKE, 2626 CEF_TEXT_STYLE_UNDERLINE, 2627 } cef_text_style_t; 2628 2629 /// 2630 // Specifies where along the main axis the CefBoxLayout child views should be 2631 // laid out. 2632 /// 2633 typedef enum { 2634 /// 2635 // Child views will be left-aligned. 2636 /// 2637 CEF_MAIN_AXIS_ALIGNMENT_START, 2638 2639 /// 2640 // Child views will be center-aligned. 2641 /// 2642 CEF_MAIN_AXIS_ALIGNMENT_CENTER, 2643 2644 /// 2645 // Child views will be right-aligned. 2646 /// 2647 CEF_MAIN_AXIS_ALIGNMENT_END, 2648 } cef_main_axis_alignment_t; 2649 2650 /// 2651 // Specifies where along the cross axis the CefBoxLayout child views should be 2652 // laid out. 2653 /// 2654 typedef enum { 2655 /// 2656 // Child views will be stretched to fit. 2657 /// 2658 CEF_CROSS_AXIS_ALIGNMENT_STRETCH, 2659 2660 /// 2661 // Child views will be left-aligned. 2662 /// 2663 CEF_CROSS_AXIS_ALIGNMENT_START, 2664 2665 /// 2666 // Child views will be center-aligned. 2667 /// 2668 CEF_CROSS_AXIS_ALIGNMENT_CENTER, 2669 2670 /// 2671 // Child views will be right-aligned. 2672 /// 2673 CEF_CROSS_AXIS_ALIGNMENT_END, 2674 } cef_cross_axis_alignment_t; 2675 2676 /// 2677 // Settings used when initializing a CefBoxLayout. 2678 /// 2679 typedef struct _cef_box_layout_settings_t { 2680 /// 2681 // If true (1) the layout will be horizontal, otherwise the layout will be 2682 // vertical. 2683 /// 2684 int horizontal; 2685 2686 /// 2687 // Adds additional horizontal space between the child view area and the host 2688 // view border. 2689 /// 2690 int inside_border_horizontal_spacing; 2691 2692 /// 2693 // Adds additional vertical space between the child view area and the host 2694 // view border. 2695 /// 2696 int inside_border_vertical_spacing; 2697 2698 /// 2699 // Adds additional space around the child view area. 2700 /// 2701 cef_insets_t inside_border_insets; 2702 2703 /// 2704 // Adds additional space between child views. 2705 /// 2706 int between_child_spacing; 2707 2708 /// 2709 // Specifies where along the main axis the child views should be laid out. 2710 /// 2711 cef_main_axis_alignment_t main_axis_alignment; 2712 2713 /// 2714 // Specifies where along the cross axis the child views should be laid out. 2715 /// 2716 cef_cross_axis_alignment_t cross_axis_alignment; 2717 2718 /// 2719 // Minimum cross axis size. 2720 /// 2721 int minimum_cross_axis_size; 2722 2723 /// 2724 // Default flex for views when none is specified via CefBoxLayout methods. 2725 // Using the preferred size as the basis, free space along the main axis is 2726 // distributed to views in the ratio of their flex weights. Similarly, if the 2727 // views will overflow the parent, space is subtracted in these ratios. A flex 2728 // of 0 means this view is not resized. Flex values must not be negative. 2729 /// 2730 int default_flex; 2731 } cef_box_layout_settings_t; 2732 2733 /// 2734 // Specifies the button display state. 2735 /// 2736 typedef enum { 2737 CEF_BUTTON_STATE_NORMAL, 2738 CEF_BUTTON_STATE_HOVERED, 2739 CEF_BUTTON_STATE_PRESSED, 2740 CEF_BUTTON_STATE_DISABLED, 2741 } cef_button_state_t; 2742 2743 /// 2744 // Specifies the horizontal text alignment mode. 2745 /// 2746 typedef enum { 2747 /// 2748 // Align the text's left edge with that of its display area. 2749 /// 2750 CEF_HORIZONTAL_ALIGNMENT_LEFT, 2751 2752 /// 2753 // Align the text's center with that of its display area. 2754 /// 2755 CEF_HORIZONTAL_ALIGNMENT_CENTER, 2756 2757 /// 2758 // Align the text's right edge with that of its display area. 2759 /// 2760 CEF_HORIZONTAL_ALIGNMENT_RIGHT, 2761 } cef_horizontal_alignment_t; 2762 2763 /// 2764 // Specifies how a menu will be anchored for non-RTL languages. The opposite 2765 // position will be used for RTL languages. 2766 /// 2767 typedef enum { 2768 CEF_MENU_ANCHOR_TOPLEFT, 2769 CEF_MENU_ANCHOR_TOPRIGHT, 2770 CEF_MENU_ANCHOR_BOTTOMCENTER, 2771 } cef_menu_anchor_position_t; 2772 2773 /// 2774 // Supported color types for menu items. 2775 /// 2776 typedef enum { 2777 CEF_MENU_COLOR_TEXT, 2778 CEF_MENU_COLOR_TEXT_HOVERED, 2779 CEF_MENU_COLOR_TEXT_ACCELERATOR, 2780 CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED, 2781 CEF_MENU_COLOR_BACKGROUND, 2782 CEF_MENU_COLOR_BACKGROUND_HOVERED, 2783 CEF_MENU_COLOR_COUNT, 2784 } cef_menu_color_type_t; 2785 2786 // Supported SSL version values. See net/ssl/ssl_connection_status_flags.h 2787 // for more information. 2788 typedef enum { 2789 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version. 2790 SSL_CONNECTION_VERSION_SSL2 = 1, 2791 SSL_CONNECTION_VERSION_SSL3 = 2, 2792 SSL_CONNECTION_VERSION_TLS1 = 3, 2793 SSL_CONNECTION_VERSION_TLS1_1 = 4, 2794 SSL_CONNECTION_VERSION_TLS1_2 = 5, 2795 SSL_CONNECTION_VERSION_TLS1_3 = 6, 2796 SSL_CONNECTION_VERSION_QUIC = 7, 2797 } cef_ssl_version_t; 2798 2799 // Supported SSL content status flags. See content/public/common/ssl_status.h 2800 // for more information. 2801 typedef enum { 2802 SSL_CONTENT_NORMAL_CONTENT = 0, 2803 SSL_CONTENT_DISPLAYED_INSECURE_CONTENT = 1 << 0, 2804 SSL_CONTENT_RAN_INSECURE_CONTENT = 1 << 1, 2805 } cef_ssl_content_status_t; 2806 2807 // 2808 // Configuration options for registering a custom scheme. 2809 // These values are used when calling AddCustomScheme. 2810 // 2811 typedef enum { 2812 CEF_SCHEME_OPTION_NONE = 0, 2813 2814 /// 2815 // If CEF_SCHEME_OPTION_STANDARD is set the scheme will be treated as a 2816 // standard scheme. Standard schemes are subject to URL canonicalization and 2817 // parsing rules as defined in the Common Internet Scheme Syntax RFC 1738 2818 // Section 3.1 available at http://www.ietf.org/rfc/rfc1738.txt 2819 // 2820 // In particular, the syntax for standard scheme URLs must be of the form: 2821 // <pre> 2822 // [scheme]://[username]:[password]@[host]:[port]/[url-path] 2823 // </pre> Standard scheme URLs must have a host component that is a fully 2824 // qualified domain name as defined in Section 3.5 of RFC 1034 [13] and 2825 // Section 2.1 of RFC 1123. These URLs will be canonicalized to 2826 // "scheme://host/path" in the simplest case and 2827 // "scheme://username:password@host:port/path" in the most explicit case. For 2828 // example, "scheme:host/path" and "scheme:///host/path" will both be 2829 // canonicalized to "scheme://host/path". The origin of a standard scheme URL 2830 // is the combination of scheme, host and port (i.e., "scheme://host:port" in 2831 // the most explicit case). 2832 // 2833 // For non-standard scheme URLs only the "scheme:" component is parsed and 2834 // canonicalized. The remainder of the URL will be passed to the handler as- 2835 // is. For example, "scheme:///some%20text" will remain the same. Non-standard 2836 // scheme URLs cannot be used as a target for form submission. 2837 /// 2838 CEF_SCHEME_OPTION_STANDARD = 1 << 0, 2839 2840 /// 2841 // If CEF_SCHEME_OPTION_LOCAL is set the scheme will be treated with the same 2842 // security rules as those applied to "file" URLs. Normal pages cannot link to 2843 // or access local URLs. Also, by default, local URLs can only perform 2844 // XMLHttpRequest calls to the same URL (origin + path) that originated the 2845 // request. To allow XMLHttpRequest calls from a local URL to other URLs with 2846 // the same origin set the CefSettings.file_access_from_file_urls_allowed 2847 // value to true (1). To allow XMLHttpRequest calls from a local URL to all 2848 // origins set the CefSettings.universal_access_from_file_urls_allowed value 2849 // to true (1). 2850 /// 2851 CEF_SCHEME_OPTION_LOCAL = 1 << 1, 2852 2853 /// 2854 // If CEF_SCHEME_OPTION_DISPLAY_ISOLATED is set the scheme can only be 2855 // displayed from other content hosted with the same scheme. For example, 2856 // pages in other origins cannot create iframes or hyperlinks to URLs with the 2857 // scheme. For schemes that must be accessible from other schemes don't set 2858 // this, set CEF_SCHEME_OPTION_CORS_ENABLED, and use CORS 2859 // "Access-Control-Allow-Origin" headers to further restrict access. 2860 /// 2861 CEF_SCHEME_OPTION_DISPLAY_ISOLATED = 1 << 2, 2862 2863 /// 2864 // If CEF_SCHEME_OPTION_SECURE is set the scheme will be treated with the same 2865 // security rules as those applied to "https" URLs. For example, loading this 2866 // scheme from other secure schemes will not trigger mixed content warnings. 2867 /// 2868 CEF_SCHEME_OPTION_SECURE = 1 << 3, 2869 2870 /// 2871 // If CEF_SCHEME_OPTION_CORS_ENABLED is set the scheme can be sent CORS 2872 // requests. This value should be set in most cases where 2873 // CEF_SCHEME_OPTION_STANDARD is set. 2874 /// 2875 CEF_SCHEME_OPTION_CORS_ENABLED = 1 << 4, 2876 2877 /// 2878 // If CEF_SCHEME_OPTION_CSP_BYPASSING is set the scheme can bypass Content- 2879 // Security-Policy (CSP) checks. This value should not be set in most cases 2880 // where CEF_SCHEME_OPTION_STANDARD is set. 2881 /// 2882 CEF_SCHEME_OPTION_CSP_BYPASSING = 1 << 5, 2883 2884 /// 2885 // If CEF_SCHEME_OPTION_FETCH_ENABLED is set the scheme can perform Fetch API 2886 // requests. 2887 /// 2888 CEF_SCHEME_OPTION_FETCH_ENABLED = 1 << 6, 2889 } cef_scheme_options_t; 2890 2891 /// 2892 // Structure representing a range. 2893 /// 2894 typedef struct _cef_range_t { 2895 int from; 2896 int to; 2897 } cef_range_t; 2898 2899 /// 2900 // Composition underline style. 2901 /// 2902 typedef enum { 2903 CEF_CUS_SOLID, 2904 CEF_CUS_DOT, 2905 CEF_CUS_DASH, 2906 CEF_CUS_NONE, 2907 } cef_composition_underline_style_t; 2908 2909 /// 2910 // Structure representing IME composition underline information. This is a thin 2911 // wrapper around Blink's WebCompositionUnderline class and should be kept in 2912 // sync with that. 2913 /// 2914 typedef struct _cef_composition_underline_t { 2915 /// 2916 // Underline character range. 2917 /// 2918 cef_range_t range; 2919 2920 /// 2921 // Text color. 2922 /// 2923 cef_color_t color; 2924 2925 /// 2926 // Background color. 2927 /// 2928 cef_color_t background_color; 2929 2930 /// 2931 // Set to true (1) for thick underline. 2932 /// 2933 int thick; 2934 2935 /// 2936 // Style. 2937 /// 2938 cef_composition_underline_style_t style; 2939 } cef_composition_underline_t; 2940 2941 /// 2942 // Enumerates the various representations of the ordering of audio channels. 2943 // Must be kept synchronized with media::ChannelLayout from Chromium. 2944 // See media\base\channel_layout.h 2945 /// 2946 typedef enum { 2947 CEF_CHANNEL_LAYOUT_NONE = 0, 2948 CEF_CHANNEL_LAYOUT_UNSUPPORTED = 1, 2949 2950 // Front C 2951 CEF_CHANNEL_LAYOUT_MONO = 2, 2952 2953 // Front L, Front R 2954 CEF_CHANNEL_LAYOUT_STEREO = 3, 2955 2956 // Front L, Front R, Back C 2957 CEF_CHANNEL_LAYOUT_2_1 = 4, 2958 2959 // Front L, Front R, Front C 2960 CEF_CHANNEL_LAYOUT_SURROUND = 5, 2961 2962 // Front L, Front R, Front C, Back C 2963 CEF_CHANNEL_LAYOUT_4_0 = 6, 2964 2965 // Front L, Front R, Side L, Side R 2966 CEF_CHANNEL_LAYOUT_2_2 = 7, 2967 2968 // Front L, Front R, Back L, Back R 2969 CEF_CHANNEL_LAYOUT_QUAD = 8, 2970 2971 // Front L, Front R, Front C, Side L, Side R 2972 CEF_CHANNEL_LAYOUT_5_0 = 9, 2973 2974 // Front L, Front R, Front C, LFE, Side L, Side R 2975 CEF_CHANNEL_LAYOUT_5_1 = 10, 2976 2977 // Front L, Front R, Front C, Back L, Back R 2978 CEF_CHANNEL_LAYOUT_5_0_BACK = 11, 2979 2980 // Front L, Front R, Front C, LFE, Back L, Back R 2981 CEF_CHANNEL_LAYOUT_5_1_BACK = 12, 2982 2983 // Front L, Front R, Front C, Side L, Side R, Back L, Back R 2984 CEF_CHANNEL_LAYOUT_7_0 = 13, 2985 2986 // Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R 2987 CEF_CHANNEL_LAYOUT_7_1 = 14, 2988 2989 // Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC 2990 CEF_CHANNEL_LAYOUT_7_1_WIDE = 15, 2991 2992 // Stereo L, Stereo R 2993 CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16, 2994 2995 // Stereo L, Stereo R, LFE 2996 CEF_CHANNEL_LAYOUT_2POINT1 = 17, 2997 2998 // Stereo L, Stereo R, Front C, LFE 2999 CEF_CHANNEL_LAYOUT_3_1 = 18, 3000 3001 // Stereo L, Stereo R, Front C, Rear C, LFE 3002 CEF_CHANNEL_LAYOUT_4_1 = 19, 3003 3004 // Stereo L, Stereo R, Front C, Side L, Side R, Back C 3005 CEF_CHANNEL_LAYOUT_6_0 = 20, 3006 3007 // Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC 3008 CEF_CHANNEL_LAYOUT_6_0_FRONT = 21, 3009 3010 // Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C 3011 CEF_CHANNEL_LAYOUT_HEXAGONAL = 22, 3012 3013 // Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center 3014 CEF_CHANNEL_LAYOUT_6_1 = 23, 3015 3016 // Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center 3017 CEF_CHANNEL_LAYOUT_6_1_BACK = 24, 3018 3019 // Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE 3020 CEF_CHANNEL_LAYOUT_6_1_FRONT = 25, 3021 3022 // Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC 3023 CEF_CHANNEL_LAYOUT_7_0_FRONT = 26, 3024 3025 // Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC 3026 CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, 3027 3028 // Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C. 3029 CEF_CHANNEL_LAYOUT_OCTAGONAL = 28, 3030 3031 // Channels are not explicitly mapped to speakers. 3032 CEF_CHANNEL_LAYOUT_DISCRETE = 29, 3033 3034 // Front L, Front R, Front C. Front C contains the keyboard mic audio. This 3035 // layout is only intended for input for WebRTC. The Front C channel 3036 // is stripped away in the WebRTC audio input pipeline and never seen outside 3037 // of that. 3038 CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30, 3039 3040 // Front L, Front R, Side L, Side R, LFE 3041 CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31, 3042 3043 // Actual channel layout is specified in the bitstream and the actual channel 3044 // count is unknown at Chromium media pipeline level (useful for audio 3045 // pass-through mode). 3046 CEF_CHANNEL_LAYOUT_BITSTREAM = 32, 3047 3048 // Max value, must always equal the largest entry ever logged. 3049 CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_BITSTREAM 3050 } cef_channel_layout_t; 3051 3052 /// 3053 // Structure representing the audio parameters for setting up the audio handler. 3054 /// 3055 typedef struct _cef_audio_parameters_t { 3056 /// 3057 // Layout of the audio channels 3058 /// 3059 cef_channel_layout_t channel_layout; 3060 3061 /// 3062 // Sample rate 3063 // 3064 int sample_rate; 3065 3066 /// 3067 // Number of frames per buffer 3068 /// 3069 int frames_per_buffer; 3070 } cef_audio_parameters_t; 3071 3072 /// 3073 // Result codes for CefMediaRouter::CreateRoute. Should be kept in sync with 3074 // Chromium's media_router::RouteRequestResult::ResultCode type. 3075 /// 3076 typedef enum { 3077 CEF_MRCR_UNKNOWN_ERROR = 0, 3078 CEF_MRCR_OK = 1, 3079 CEF_MRCR_TIMED_OUT = 2, 3080 CEF_MRCR_ROUTE_NOT_FOUND = 3, 3081 CEF_MRCR_SINK_NOT_FOUND = 4, 3082 CEF_MRCR_INVALID_ORIGIN = 5, 3083 CEF_MRCR_NO_SUPPORTED_PROVIDER = 7, 3084 CEF_MRCR_CANCELLED = 8, 3085 CEF_MRCR_ROUTE_ALREADY_EXISTS = 9, 3086 CEF_MRCR_ROUTE_ALREADY_TERMINATED = 11, 3087 3088 CEF_MRCR_TOTAL_COUNT = 12 // The total number of values. 3089 } cef_media_route_create_result_t; 3090 3091 /// 3092 // Connection state for a MediaRoute object. 3093 /// 3094 typedef enum { 3095 CEF_MRCS_UNKNOWN, 3096 CEF_MRCS_CONNECTING, 3097 CEF_MRCS_CONNECTED, 3098 CEF_MRCS_CLOSED, 3099 CEF_MRCS_TERMINATED, 3100 } cef_media_route_connection_state_t; 3101 3102 /// 3103 // Icon types for a MediaSink object. Should be kept in sync with Chromium's 3104 // media_router::SinkIconType type. 3105 /// 3106 typedef enum { 3107 CEF_MSIT_CAST, 3108 CEF_MSIT_CAST_AUDIO_GROUP, 3109 CEF_MSIT_CAST_AUDIO, 3110 CEF_MSIT_MEETING, 3111 CEF_MSIT_HANGOUT, 3112 CEF_MSIT_EDUCATION, 3113 CEF_MSIT_WIRED_DISPLAY, 3114 CEF_MSIT_GENERIC, 3115 3116 CEF_MSIT_TOTAL_COUNT, // The total number of values. 3117 } cef_media_sink_icon_type_t; 3118 3119 /// 3120 // Device information for a MediaSink object. 3121 /// 3122 typedef struct _cef_media_sink_device_info_t { 3123 cef_string_t ip_address; 3124 int port; 3125 cef_string_t model_name; 3126 } cef_media_sink_device_info_t; 3127 3128 /// 3129 // Represents commands available to TextField. 3130 /// 3131 typedef enum { 3132 CEF_TFC_CUT = 1, 3133 CEF_TFC_COPY, 3134 CEF_TFC_PASTE, 3135 CEF_TFC_UNDO, 3136 CEF_TFC_DELETE, 3137 CEF_TFC_SELECT_ALL, 3138 } cef_text_field_commands_t; 3139 3140 /// 3141 // Supported Chrome toolbar types. 3142 /// 3143 typedef enum { 3144 CEF_CTT_NONE = 1, 3145 CEF_CTT_NORMAL, 3146 CEF_CTT_LOCATION, 3147 } cef_chrome_toolbar_type_t; 3148 3149 /// 3150 // Docking modes supported by CefWindow::AddOverlay. 3151 /// 3152 typedef enum { 3153 CEF_DOCKING_MODE_TOP_LEFT = 1, 3154 CEF_DOCKING_MODE_TOP_RIGHT, 3155 CEF_DOCKING_MODE_BOTTOM_LEFT, 3156 CEF_DOCKING_MODE_BOTTOM_RIGHT, 3157 CEF_DOCKING_MODE_CUSTOM, 3158 } cef_docking_mode_t; 3159 3160 /// 3161 // Show states supported by CefWindowDelegate::GetInitialShowState. 3162 /// 3163 typedef enum { 3164 CEF_SHOW_STATE_NORMAL = 1, 3165 CEF_SHOW_STATE_MINIMIZED, 3166 CEF_SHOW_STATE_MAXIMIZED, 3167 CEF_SHOW_STATE_FULLSCREEN, 3168 } cef_show_state_t; 3169 3170 #ifdef __cplusplus 3171 } 3172 #endif 3173 3174 #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ 3175