Skip to content

Commit

Permalink
Update to CEF 3.2526.1373.gb660893 (Chrome 47)...
Browse files Browse the repository at this point in the history
It builds fine on Linux, however there is an error when running during import
of the cefpython .so module (Issue cztomczak#230).

Upstream CEF binaries and libraries are available for download from the
GH releases tagged 'v47-upstream'.

Changes in upstream CEF that break backward compatibility:
* Add Browser.NotifyMoveOrResizeStarted() - requires changes in examples,
  needs to be called in MOVE/SIZE window operations
* On Linux the windowRect argument in WindowInfo.SetAsChild() is now required
* When using offscreen rendering you must set the ApplicationSettings >
  "windowless_rendering_enabled" option to True
* New args in LifespanHandler.OnBeforePopup() - targetDisposition
  and userGesture - wxpython.py example updated
* New arg in RequestHandler.OnResourceRedirect() - request object, updated
  the wxpython.py example

Other changes in API:
* Change ApplicationSettings. Add new: user_data_path,
  windowless_rendering_enabled, persist_user_preferences, accept_language_list.
  Modify: background_color is now cross-platform (previously it was Mac only).
  Remove: release_dcheck_enabled - all examples updated
* Change BrowserSettings. Add new: windowless_frame_rate, background_color,
  accept_language_list. Remove: user_style_sheet_location,
  java_disabled, accelerated_compositing, author_and_user_styles_disabled.
* Add Browser.CloseDevTools()
* Remove Browser.ParentWindowWillClose()  in upstream (keep dummy for BC)
* Request.GetHeaderMap() will not include the Referer value if any
  and SetHeaderMap() will ignore Referer value
* Remove the cefpython.Request.Flags values: AllowCookies, ReportLoadTiming,
  ReportRawHeaders.
* Update descriptions of many functions and settings in API docs
* There were many more API changes in upstream, but are not yet implemented
  in cefpython. A list of changes since v31..v47 is available in the
  top comment in src/cefpython.pyx

Improve integration with PyCharm:
- add include "cefpython.pyx" in all .pyx files
- many other fixes

Set these settings in Pycharm:
- in Tool Windows > Project right click on src/cython_includes dir and
  select Mark Directory As > Mark as Sources Root
- PEP8 naming convention violation: ignored errors: N802, N803, N806
- in Inspections > unresolved references add to ignore: UNAME_SYSNAME
  and PY_MAJOR_VERSION and others that cause issues in PyCharm
- templates usage like CefRefPtr[CefApp] always shows "unresolved reference"
  error - to fix it add CefApp and others to ignore list (easy with alt+enter
  and fix single or fix all in file)

Remove duplicated comments in all C++ classes/methods that implement CEF API,
eg. client_handler.cpp and client_handler.h. Comments describing method
can be found in src/include/. Duplicating it might mislead when the comment
is not updated when updating to newer CEF.

Remove LOG macros in LOG_DEBUG.h - name conflicts with cef_logging.h
(issue cef/#1830).
  • Loading branch information
cztomczak committed Jun 25, 2016
1 parent c4b5ef5 commit bc3b9aa
Show file tree
Hide file tree
Showing 233 changed files with 20,160 additions and 3,752 deletions.
509 changes: 257 additions & 252 deletions docs/api/API-index.md

Large diffs are not rendered by default.

252 changes: 164 additions & 88 deletions docs/api/ApplicationSettings.md

Large diffs are not rendered by default.

33 changes: 26 additions & 7 deletions docs/api/Browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Table of contents:
* [CanGoBack](#cangoback)
* [CanGoForward](#cangoforward)
* [CloseBrowser](#closebrowser)
* [CloseDevTools](#closedevtools)
* [ExecuteFunction](#executefunction)
* [ExecuteJavascript](#executejavascript)
* [Find](#find)
Expand Down Expand Up @@ -44,6 +45,7 @@ Table of contents:
* [IsWindowRenderingDisabled](#iswindowrenderingdisabled)
* [LoadUrl](#loadurl)
* [Navigate](#navigate)
* [NotifyMoveOrResizeStarted](#notifymoveorresizestarted)
* [NotifyScreenInfoChanged](#notifyscreeninfochanged)
* [ParentWindowWillClose](#parentwindowwillclose)
* [Reload](#reload)
Expand Down Expand Up @@ -118,6 +120,16 @@ LifespanHandler::DoClose() documentation for additional usage
information.


### CloseDevTools

| | |
| --- | --- |
| __Return__ | bool |

Explicitly close the developer tools window if one exists for this browser
instance.


### ExecuteFunction

| Parameter | Type |
Expand Down Expand Up @@ -160,7 +172,7 @@ Calling javascript from native code synchronously is not possible in CEF 3. It i
| findNext | bool |
| __Return__ | void |

Search for |searchText|. |searchID| can be custom, it is so that you can have multiple searches running simultaneously. |forward| indicates whether to search forward or backward within the page. |matchCase| indicates whether the search should be case-sensitive. |findNext| indicates whether this is the first request or a follow-up.
Search for |searchText|. |searchID| can be custom, it is so that you can have multiple searches running simultaneously. |forward| indicates whether to search forward or backward within the page. |matchCase| indicates whether the search should be case-sensitive. |findNext| indicates whether this is the first request or a follow-up. The CefFindHandler instance, if any, returned via CefClient::GetFindHandler will be called to report find results.


### GetClientCallback
Expand Down Expand Up @@ -467,6 +479,16 @@ Load url in the main frame.
This is an alias for the `LoadUrl` method.


### NotifyMoveOrResizeStarted

| | |
| --- | --- |
| __Return__ | void |

Notify the browser that the window hosting it is about to be moved or
resized. This method is only used on Windows and Linux.


### NotifyScreenInfoChanged

| | |
Expand All @@ -487,10 +509,7 @@ disabled.
| --- | --- |
| __Return__ | void |

Call this method before destroying a contained browser window. This method
performs any internal cleanup that may be needed before the browser window
is destroyed. See [LifespanHandler](LifespanHandler.md)::DoClose() documentation for
additional usage information.
This method does nothing. Kept for BC.


### Reload
Expand Down Expand Up @@ -634,10 +653,10 @@ Set client handler object (class instance), its members will be inspected. Priva

| Parameter | Type |
| --- | --- |
| enable | bool |
| focus | bool |
| __Return__ | void |

Set focus for the browser window. If |enable| is true focus will be set to the window. Otherwise, focus will be removed.
Set whether the browser is focused.


### SetMouseCursorChangeDisabled
Expand Down
49 changes: 33 additions & 16 deletions docs/api/BrowserSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Table of contents:
* [Introduction](#introduction)
* [Settings](#settings)
* [Font settings](#font-settings)
* [accelerated_compositing_disabled](#accelerated_compositing_disabled)
* [accept_language_list](#accept_language_list)
* [application_cache_disabled](#application_cache_disabled)
* [author_and_user_styles_disabled](#author_and_user_styles_disabled)
* [background_color](#background_color)
* [caret_browsing_enabled](#caret_browsing_enabled)
* [databases_disabled](#databases_disabled)
* [default_encoding](#default_encoding)
Expand All @@ -21,7 +21,6 @@ Table of contents:
* [javascript_open_windows_disallowed](#javascript_open_windows_disallowed)
* [javascript_close_windows_disallowed](#javascript_close_windows_disallowed)
* [javascript_access_clipboard_disallowed](#javascript_access_clipboard_disallowed)
* [java_disabled](#java_disabled)
* [local_storage_disabled](#local_storage_disabled)
* [plugins_disabled](#plugins_disabled)
* [remote_fonts](#remote_fonts)
Expand All @@ -32,11 +31,13 @@ Table of contents:
* [user_style_sheet_location](#user_style_sheet_location)
* [web_security_disabled](#web_security_disabled)
* [webgl_disabled](#webgl_disabled)
* [windowless_frame_rate](#windowless_frame_rate)


## Introduction

These settings can be passed to [cefpython](cefpython.md).CreateBrowser().
This dictionary of settings can be passed to
[cefpython](cefpython.md).CreateBrowser().

Many of these settings have their command line switch equivalent, see the [CommandLineSwitches](CommandLineSwitches.md) page.

Expand All @@ -60,21 +61,28 @@ In some cases, the default values of settings that are suggested by its name may
* minimum_logical_font_size (int)


### accelerated_compositing_disabled
### accept_language_list

(bool) Controls whether content that depends on accelerated compositing can be used. Note that accelerated compositing requires hardware support and may not work on all systems even when enabled. Also configurable using the --disable-accelerated-compositing switch.
(string)
Comma delimited ordered list of language codes without any whitespace that
will be used in the "Accept-Language" HTTP header. May be set globally
using the CefBrowserSettings.accept_language_list value. If both values are
empty then "en-US,en" will be used.


### application_cache_disabled

(bool) Controls whether the application cache can be used. Also configurable using the --disable-application-cache switch.


### author_and_user_styles_disabled
### background_color

(bool) Controls whether style sheets can be used. Also configurable using the --disable-author-and-user-styles switch.

This setting was removed in Chrome 33. Soon it will be removed from cefpython as well.
(int)
Opaque background color used for the browser before a document is loaded
and when no document color is specified. By default the background color
will be the same as CefSettings.background_color. Only the RGB compontents
of the specified value will be used. The alpha component must greater than
0 to enable use of the background color but will be otherwise ignored.


### caret_browsing_enabled
Expand Down Expand Up @@ -119,19 +127,18 @@ This setting was removed in Chrome 33. Soon it will be removed from cefpython as

### javascript_close_windows_disallowed

(bool) Controls whether Javascript can be used to close windows that were not opened via Javascript. Javascript can still be used to close windows that were opened via Javascript. Also configurable using the --disable-javascript-close-windows switch.
(bool) Controls whether JavaScript can be used to close windows that were not
opened via JavaScript. JavaScript can still be used to close windows that
were opened via JavaScript or that have no back/forward history. Also
configurable using the "disable-javascript-close-windows" command-line
switch.


### javascript_access_clipboard_disallowed

(bool) Controls whether Javascript can access the clipboard. Also configurable using the --disable-javascript-access-clipboard switch.


### java_disabled

(bool) Controls whether the Java plugin will be loaded. Also configurable using the --disable-java switch.


### local_storage_disabled

(bool) Controls whether local storage can be used. Also configurable using the --disable-local-storage switch.
Expand Down Expand Up @@ -182,3 +189,13 @@ This setting was removed in Chrome 33. Soon it will be removed from cefpython as
### webgl_disabled

(bool) Controls whether WebGL can be used. Note that WebGL requires hardware support and may not work on all systems even when enabled. Also configurable using the --disable-webgl switch.


### windowless_frame_rate

(int) The maximum rate in frames per second (fps) that
CefRenderHandler::OnPaint will be called for a windowless browser.
The actual fps may be lower if the browser cannot generate frames at the
requested rate. The minimum value is 1 and the maximum value is 60
(default 30). This value can also be changed dynamically via
CefBrowserHost::SetWindowlessFrameRate.
84 changes: 45 additions & 39 deletions docs/api/CookieManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ static method for this purpose.

The cookie tests can be found in the wxpython.py script.

TODO: in upstream CEF some methods here have a callback parameter
that when non-NULL will execute asynchronously on the IO thread
when storage has been initialized. SetCookie and DeleteCookies
also have an OnComplete callback.


Table of contents:
* [Methods](#methods)
Expand Down Expand Up @@ -61,9 +66,9 @@ see [RequestHandler](RequestHandler.md).GetCookieManager().
| schemes | list |
| __Return__ | void |

Set the schemes supported by this manager. By default only "http" and
"https" schemes are supported. Must be called before any cookies are
accessed.
Set the schemes supported by this manager. The default schemes ("http",
"https", "ws" and "wss") will always be supported. Must be called before
any cookies are accessed.


### VisitAllCookies
Expand All @@ -73,14 +78,14 @@ accessed.
| object | [CookieVisitor](CookieVisitor.md) |
| __Return__ | bool |

Visit all cookies. The returned cookies are ordered by longest path,
then by earliest creation date. Returns false if cookies cannot be
accessed.
Visit all cookies on the IO thread. The returned cookies are ordered by
longest path, then by earliest creation date. Returns false if cookies
cannot be accessed.

The `CookieVisitor` object is a python class that implements the `CookieVisitor`
callbacks. You must keep a strong reference to the `CookieVisitor` object while
visiting cookies, otherwise it gets destroyed and the `CookieVisitor` callbacks
won't be called.
The `CookieVisitor` object is a python class that implements the
CookieVisitor`callbacks. You must keep a strong reference to the
CookieVisitor` object while visiting cookies, otherwise it gets
destroyed and the `CookieVisitor` callbacks won't be called.


### VisitUrlCookies
Expand All @@ -92,16 +97,16 @@ won't be called.
| object | [CookieVisitor](CookieVisitor.md) |
| __Return__ | bool |

Visit a subset of cookies. The results are filtered by the given url
scheme, host, domain and path. If |includeHttpOnly| is true HTTP-only
cookies will also be included in the results. The returned cookies are
ordered by longest path, then by earliest creation date. Returns false
if cookies cannot be accessed.
Visit a subset of cookies on the IO thread. The results are filtered by the
given url scheme, host, domain and path. If |includeHttpOnly| is true
HTTP-only cookies will also be included in the results. The returned
cookies are ordered by longest path, then by earliest creation date.
Returns false if cookies cannot be accessed.

The `CookieVisitor` object is a python class that implements the `CookieVisitor`
callbacks. You must keep a strong reference to the `CookieVisitor` object while
visiting cookies, otherwise it gets destroyed and the `CookieVisitor` callbacks
won't be called.
The `CookieVisitor` object is a python class that implements the
`CookieVisitor` callbacks. You must keep a strong reference to the
`CookieVisitor` object while visiting cookies, otherwise it gets destroyed
and the `CookieVisitor` callbacks won't be called.


### SetCookie
Expand All @@ -114,15 +119,16 @@ won't be called.

Sets a cookie given a valid URL and a `Cookie` object.
It will check for disallowed characters (e.g. the ';' character is disallowed
within the cookie value attribute) and will not set the cookie if such
characters are found.
within the cookie value attribute) and fail without setting the cookie if
such characters are found. Returns
false if an invalid URL is specified or if cookies cannot be accessed.

The CEF C++ equivalent function will be called on the IO thread, thus it executes
asynchronously, when this method returns the cookie will not yet be set.
The CEF C++ equivalent function will be called on the IO thread, thus
it executes asynchronously, when this method returns the cookie will
not yet be set.

TODO: the CEF C++ function returns a true or false value depending on whether it
succeeded or failed, the return value is not yet implemented in CEF Python,
as there is currently no API exposed to CEF Python for posting tasks on various threads.
TODO: the CEF C++ function returns false if an invalid URL
is specified or if cookies cannot be accessed.


### DeleteCookies
Expand All @@ -134,18 +140,18 @@ as there is currently no API exposed to CEF Python for posting tasks on various
| __Return__ | void |

Delete all cookies that match the specified parameters. If both |url| and
values |cookie_name| are specified all host and domain cookies matching
|cookie_name| values are specified all host and domain cookies matching
both will be deleted. If only |url| is specified all host cookies (but not
domain cookies) irrespective of path will be deleted. If |url| is empty all
cookies for all hosts and domains will be deleted. Deleting cookies will fail
if a non-empty invalid URL is specified or if cookies cannot be accessed.
cookies for all hosts and domains will be deleted.
Cookies can alternately be deleted using the Visit*Cookies() methods.

The CEF C++ equivalent function will be called on the IO thread, thus it executes
asynchronously, when this method returns the cookies will not yet be deleted.
The CEF C++ equivalent function will be called on the IO thread,
thus it executes asynchronously, when this method returns the cookies
will not yet be deleted.

TODO: the CEF C++ function returns a true or false value depending on whether it
succeeded or failed, the return value is not yet implemented in CEF Python,
as there is currently no API exposed to CEF Python for posting tasks on various threads.
TODO: the CEF C++ function returns false if a non-empty invalid URL is
specified or if cookies cannot be accessed.


### SetStoragePath
Expand All @@ -160,8 +166,8 @@ Sets the directory path that will be used for storing cookie data. If
|path| is empty data will be stored in memory only. Otherwise, data will be
stored at the specified |path|. To persist session cookies (cookies without
an expiry date or validity interval) set |persist_session_cookies| to true.
Session cookies are generally intended to be transient and most Web browsers
do not persist them. Returns false if cookies cannot be accessed.
Session cookies are generally intended to be transient and most Web
browsers do not persist them. Returns false if cookies cannot be accessed.


### FlushStore
Expand All @@ -173,6 +179,6 @@ do not persist them. Returns false if cookies cannot be accessed.

Not yet implemented.

Flush the backing store (if any) to disk and execute the specified
|handler| on the IO thread when done. Returns false if cookies cannot be
accessed.
Flush the backing store (if any) to disk. If |callback| is non-NULL it will
be executed asnychronously on the IO thread after the flush is complete.
Returns false if cookies cannot be accessed.
2 changes: 2 additions & 0 deletions docs/api/Frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Returns the parent of this frame or None if this is the main (top-level) frame.
Frame identifiers are unique per render process, they are not
globally unique.

Returns < 0 if the underlying frame does not yet exist.


### GetBrowserIdentifier

Expand Down
27 changes: 15 additions & 12 deletions docs/api/JavascriptDialogHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@ pressed. The |userInput| value should be specified for prompt dialogs.
| suppress_message[0] | bool& |
| __Return__ | bool |

Called to run a Javascript dialog. The |default_prompt_text| value will be
specified for prompt dialogs only. Set |suppress_message| to true and
return false to suppress the message (suppressing messages is preferable
to immediately executing the callback as this is used to detect presumably
malicious behavior like spamming alert messages in onbeforeunload). Set
|suppress_message| to false and return false to use the default
implementation (the default implementation will show one modal dialog at a
time and suppress any additional dialog requests until the displayed dialog
is dismissed). Return true if the application will use a custom dialog or
if the callback has been executed immediately. Custom dialogs may be either
modal or modeless. If a custom dialog is used the application must execute
|callback| once the custom dialog is dismissed.
Called to run a JavaScript dialog. If |origin_url| and |accept_lang| are
non-empty they can be passed to the CefFormatUrlForSecurityDisplay function
to retrieve a secure and user-friendly display string. The
|default_prompt_text| value will be specified for prompt dialogs only. Set
|suppress_message| to true and return false to suppress the message
(suppressing messages is preferable to immediately executing the callback
as this is used to detect presumably malicious behavior like spamming alert
messages in onbeforeunload). Set |suppress_message| to false and return
false to use the default implementation (the default implementation will
show one modal dialog at a time and suppress any additional dialog requests
until the displayed dialog is dismissed). Return true if the application
will use a custom dialog or if the callback has been executed immediately.
Custom dialogs may be either modal or modeless. If a custom dialog is used
the application must execute |callback| once the custom dialog is
dismissed.

The `dialog_type` param may be one of:
```
Expand Down
Loading

0 comments on commit bc3b9aa

Please sign in to comment.