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