Skip to content

Commit 0dce933

Browse files
committed
Chrome 29 release for Windows.
Fixed compiler error: "PaintBuffer" class already implemented. Minor fixes and debugging enhancements to the wx Chrome control.
1 parent 2fb1b75 commit 0dce933

File tree

4 files changed

+78
-30
lines changed

4 files changed

+78
-30
lines changed

cefpython/cef3/windows/binaries/README.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Chromium Embedded Framework (CEF) Standard Binary Distribution for Windows
22
-------------------------------------------------------------------------------
33

4-
Date: August 06, 2013
4+
Date: November 06, 2013
55

6-
CEF Version: 3.1453.1352
7-
CEF URL: http://chromiumembedded.googlecode.com/svn/branches/1453/cef3@1352
6+
CEF Version: 3.1547.1491
7+
CEF URL: http://chromiumembedded.googlecode.com/svn/branches/1547/cef3@1491
88

9-
Chromium Verison: 27.0.1453.116
10-
Chromium URL: http://src.chromium.org/svn/branches/1453/src@206485
9+
Chromium Verison: 29.0.1547.80
10+
Chromium URL: http://src.chromium.org/svn/branches/1547/src@226504
1111

1212
This distribution contains all components necessary to build and distribute an
1313
application using CEF on the Windows platform. Please see the LICENSING

cefpython/cef3/windows/setup/cefpython.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ __PYX_EXTERN_C DL_IMPORT(bool) DisplayHandler_OnConsoleMessage(CefRefPtr<CefBrow
2727
__PYX_EXTERN_C DL_IMPORT(bool) KeyboardHandler_OnPreKeyEvent(CefRefPtr<CefBrowser>, CefKeyEvent const &, CefEventHandle, bool *);
2828
__PYX_EXTERN_C DL_IMPORT(bool) KeyboardHandler_OnKeyEvent(CefRefPtr<CefBrowser>, CefKeyEvent const &, CefEventHandle);
2929
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_OnBeforeResourceLoad(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefRequest>);
30+
__PYX_EXTERN_C DL_IMPORT(CefRefPtr<CefResourceHandler>) RequestHandler_GetResourceHandler(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefRequest>);
3031
__PYX_EXTERN_C DL_IMPORT(void) RequestHandler_OnResourceRedirect(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefString const &, CefString &);
3132
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_GetAuthCredentials(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, bool, CefString const &, int, CefString const &, CefString const &, CefRefPtr<CefAuthCallback>);
3233
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_OnQuotaRequest(CefRefPtr<CefBrowser>, CefString const &, int64, CefRefPtr<CefQuotaCallback>);
@@ -41,6 +42,26 @@ __PYX_EXTERN_C DL_IMPORT(void) LoadHandler_OnLoadError(CefRefPtr<CefBrowser>, Ce
4142
__PYX_EXTERN_C DL_IMPORT(void) LoadHandler_OnRendererProcessTerminated(CefRefPtr<CefBrowser>, enum cef_termination_status_t);
4243
__PYX_EXTERN_C DL_IMPORT(void) LoadHandler_OnPluginCrashed(CefRefPtr<CefBrowser>, CefString const &);
4344
__PYX_EXTERN_C DL_IMPORT(void) BrowserProcessHandler_OnRenderProcessThreadCreated(CefRefPtr<CefListValue>);
45+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetRootScreenRect(CefRefPtr<CefBrowser>, CefRect &);
46+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetViewRect(CefRefPtr<CefBrowser>, CefRect &);
47+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetScreenRect(CefRefPtr<CefBrowser>, CefRect &);
48+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetScreenPoint(CefRefPtr<CefBrowser>, int, int, int &, int &);
49+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetScreenInfo(CefRefPtr<CefBrowser>, CefScreenInfo &);
50+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnPopupShow(CefRefPtr<CefBrowser>, bool);
51+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnPopupSize(CefRefPtr<CefBrowser>, CefRect const &);
52+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnPaint(CefRefPtr<CefBrowser>, cef_paint_element_type_t, std::vector<CefRect> &, void const *, int, int);
53+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnCursorChange(CefRefPtr<CefBrowser>, CefCursorHandle);
54+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnScrollOffsetChanged(CefRefPtr<CefBrowser>);
55+
__PYX_EXTERN_C DL_IMPORT(bool) ResourceHandler_ProcessRequest(int, CefRefPtr<CefRequest>, CefRefPtr<CefCallback>);
56+
__PYX_EXTERN_C DL_IMPORT(void) ResourceHandler_GetResponseHeaders(int, CefRefPtr<CefResponse>, int64 &, CefString &);
57+
__PYX_EXTERN_C DL_IMPORT(bool) ResourceHandler_ReadResponse(int, void *, int, int &, CefRefPtr<CefCallback>);
58+
__PYX_EXTERN_C DL_IMPORT(bool) ResourceHandler_CanGetCookie(int, CefCookie const &);
59+
__PYX_EXTERN_C DL_IMPORT(bool) ResourceHandler_CanSetCookie(int, CefCookie const &);
60+
__PYX_EXTERN_C DL_IMPORT(void) ResourceHandler_Cancel(int);
61+
__PYX_EXTERN_C DL_IMPORT(void) WebRequestClient_OnUploadProgress(int, CefRefPtr<CefURLRequest>, uint64, uint64);
62+
__PYX_EXTERN_C DL_IMPORT(void) WebRequestClient_OnDownloadProgress(int, CefRefPtr<CefURLRequest>, uint64, uint64);
63+
__PYX_EXTERN_C DL_IMPORT(void) WebRequestClient_OnDownloadData(int, CefRefPtr<CefURLRequest>, void const *, size_t);
64+
__PYX_EXTERN_C DL_IMPORT(void) WebRequestClient_OnRequestComplete(int, CefRefPtr<CefURLRequest>);
4465

4566
#endif /* !__PYX_HAVE_API__cefpython_py27 */
4667

cefpython/cef3/wx-subpackage/chromectrl.py

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,14 @@ class ChromeWindow(wx.Window):
8989
Standalone CEF component. The class provides facilites for interacting
9090
with wx message loop
9191
"""
92-
def __init__(self, parent, url="", useTimer=False,
93-
timerMillis=DEFAULT_TIMER_MILLIS, size=(-1, -1),
94-
*args, **kwargs):
92+
def __init__(self, parent, url="", useTimer=None,
93+
timerMillis=DEFAULT_TIMER_MILLIS, browserSettings=None,
94+
size=(-1, -1), *args, **kwargs):
95+
if platform.system() == "Linux" and useTimer == None:
96+
# On Linux OnIdle does not work correctly, must use timer.
97+
useTimer = True
98+
useTimer = bool(useTimer)
99+
95100
wx.Window.__init__(self, parent, id=wx.ID_ANY, size=size,
96101
*args, **kwargs)
97102
# On Linux absolute file urls need to start with "file://"
@@ -109,8 +114,8 @@ def __init__(self, parent, url="", useTimer=False,
109114
else:
110115
raise Exception("Unsupported OS")
111116

112-
# TODO: allow for custom browser settings for the ChromeWindow
113-
browserSettings = {}
117+
if not browserSettings:
118+
browserSettings = {}
114119

115120
# Disable plugins:
116121
# | browserSettings["plugins_disabled"] = True
@@ -170,18 +175,37 @@ def LoadUrl(self, url, onLoadStart=None, onLoadEnd=None):
170175
if onLoadStart or onLoadEnd:
171176
self.GetBrowser().SetClientHandler(
172177
CallbackClientHandler(onLoadStart, onLoadEnd))
178+
179+
browser = self.GetBrowser()
180+
if cefpython.g_debug:
181+
print("***** ChromeCtrl: LoadUrl() self: %s" % self)
182+
print("***** ChromeCtrl: browser: %s" % browser)
183+
print("***** ChromeCtrl: browser id: %s" % browser.GetIdentifier())
184+
print("***** ChromeCtrl: mainframe: %s" % browser.GetMainFrame())
185+
print("***** ChromeCtrl: mainframe id: %s" % \
186+
browser.GetMainFrame().GetIdentifier())
173187
self.GetBrowser().GetMainFrame().LoadUrl(url)
174188

189+
#wx.CallLater(100, browser.ReloadIgnoreCache)
190+
#wx.CallLater(200, browser.GetMainFrame().LoadUrl, url)
191+
175192

176193
class ChromeCtrl(wx.Panel):
177-
def __init__(self, parent, url="", useTimer=False,
178-
timerMillis=DEFAULT_TIMER_MILLIS, hasNavBar=True,
194+
def __init__(self, parent, url="", useTimer=None,
195+
timerMillis=DEFAULT_TIMER_MILLIS,
196+
browserSettings=None, hasNavBar=True,
179197
*args, **kwargs):
198+
if platform.system() == "Linux" and useTimer == None:
199+
# On Linux OnIdle does not work correctly, must use timer.
200+
useTimer = True
201+
useTimer = bool(useTimer)
202+
180203
# You also have to set the wx.WANTS_CHARS style for
181204
# all parent panels/controls, if it's deeply embedded.
182205
wx.Panel.__init__(self, parent, style=wx.WANTS_CHARS, *args, **kwargs)
183206

184-
self.chromeWindow = ChromeWindow(self, url=str(url), useTimer=useTimer)
207+
self.chromeWindow = ChromeWindow(self, url=str(url), useTimer=useTimer,
208+
browserSettings=browserSettings)
185209
sizer = wx.BoxSizer(wx.VERTICAL)
186210
self.navigationBar = None
187211
if hasNavBar:
@@ -280,30 +304,30 @@ def OnLoadStart(self, browser, frame):
280304
def OnLoadEnd(self, browser, frame, httpStatusCode):
281305
self.parentCtrl.OnLoadEnd(browser, frame, httpStatusCode)
282306

283-
def OnLoadError(self, browser, frame, errorCode, failedUrl, errorText):
307+
def OnLoadError(self, browser, frame, errorCode, errorText, failedUrl):
284308
# TODO
285-
print("ERROR LOADING URL : %s" % failedUrl)
309+
print("***** ChromeCtrl: ERROR LOADING URL : %s" % failedUrl)
286310

287311
class CallbackClientHandler(object):
288312
def __init__(self, onLoadStart=None, onLoadEnd=None):
289-
self.onLoadStart = onLoadStart
290-
self.onLoadEnd = onLoadEnd
313+
self._onLoadStart = onLoadStart
314+
self._onLoadEnd = onLoadEnd
291315

292316
def OnLoadStart(self, browser, frame):
293-
if self.onLoadStart and frame.GetUrl() != "about:blank":
294-
self.onLoadStart(browser, frame)
317+
if self._onLoadStart and frame.GetUrl() != "about:blank":
318+
self._onLoadStart(browser, frame)
295319

296320
def OnLoadEnd(self, browser, frame, httpStatusCode):
297-
if self.onLoadEnd and frame.GetUrl() != "about:blank":
298-
self.onLoadEnd(browser, frame, httpStatusCode)
321+
if self._onLoadEnd and frame.GetUrl() != "about:blank":
322+
self._onLoadEnd(browser, frame, httpStatusCode)
299323

300-
def OnLoadError(self, browser, frame, errorCode, failedUrl, errorText):
324+
def OnLoadError(self, browser, frame, errorCode, errorText, failedUrl):
301325
# TODO
302-
print("ERROR LOADING URL : %s" % failedUrl)
326+
print("***** ChromeCtrl: ERROR LOADING URL : %s, %s" % (failedUrl, frame.GetUrl()))
303327

304328
#-------------------------------------------------------------------------------
305329

306-
def Initialize(settings=None):
330+
def Initialize(settings=None, debug=False):
307331
"""Initializes CEF, We should do it before initializing wx
308332
If no settings passed a default is used
309333
"""
@@ -327,11 +351,14 @@ def Initialize(settings=None):
327351

328352
# DEBUGGING options:
329353
# ------------------
330-
# cefpython.g_debug = True
331-
# cefpython.g_debugFile = "debug.log"
332-
# settings["log_severity"] = cefpython.LOGSEVERITY_VERBOSE
333-
# settings["log_file"] = "debug.log" # Set to "" to disable.
334-
# settings["release_dcheck_enabled"] = True
354+
if debug:
355+
cefpython.g_debug = True
356+
cefpython.g_debugFile = "debug.log"
357+
settings["log_severity"] = cefpython.LOGSEVERITY_VERBOSE
358+
settings["log_file"] = "debug.log" # Set to "" to disable.
359+
settings["release_dcheck_enabled"] = True
360+
else:
361+
cefpython.g_debug = False
335362

336363
cefpython.Initialize(settings)
337364

cefpython/cefpython.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ include "browser.pyx"
107107
include "frame.pyx"
108108

109109
include "settings.pyx"
110-
IF UNAME_SYSNAME == "Windows":
110+
IF UNAME_SYSNAME == "Windows" and CEF_VERSION == 1:
111111
# Off-screen rendering currently supported only on Windows
112112
include "paint_buffer_cef1.pyx"
113113

0 commit comments

Comments
 (0)