@@ -137,15 +137,10 @@ include "browser.pyx"
137137include " frame.pyx"
138138
139139include " settings.pyx"
140- IF UNAME_SYSNAME == " Windows" and CEF_VERSION == 1 :
141- # Off-screen rendering currently supported only on Windows
142- include " paint_buffer_cef1.pyx"
143140
144141IF UNAME_SYSNAME == " Windows" :
145142 include " window_utils_win.pyx"
146143 include " dpi_aware_win.pyx"
147- IF CEF_VERSION == 1 :
148- include " http_authentication_win.pyx"
149144ELIF UNAME_SYSNAME == " Linux" :
150145 include " window_utils_linux.pyx"
151146ELIF UNAME_SYSNAME == " Darwin" :
@@ -302,29 +297,27 @@ def Initialize(applicationSettings=None, commandLineSwitches=None):
302297 # CEF options - default values.
303298 if not " multi_threaded_message_loop" in applicationSettings:
304299 applicationSettings[" multi_threaded_message_loop" ] = False
305- IF CEF_VERSION == 3 :
306- if not " single_process" in applicationSettings:
307- applicationSettings[" single_process" ] = False
300+ if not " single_process" in applicationSettings:
301+ applicationSettings[" single_process" ] = False
308302
309303 cdef CefRefPtr[CefApp] cefApp
310304
311- IF CEF_VERSION == 3 :
312- cefApp = < CefRefPtr[CefApp]?> new CefPythonApp()
313- IF UNAME_SYSNAME == " Windows" :
314- cdef HINSTANCE hInstance = GetModuleHandle(NULL )
315- cdef CefMainArgs cefMainArgs = CefMainArgs(hInstance)
316- ELIF UNAME_SYSNAME == " Linux" :
317- # TODO: use the CefMainArgs(int argc, char** argv) constructor.
318- cdef CefMainArgs cefMainArgs
319- ELIF UNAME_SYSNAME == " Darwin" :
320- # TODO: use the CefMainArgs(int argc, char** argv) constructor.
321- cdef CefMainArgs cefMainArgs
322- cdef int exitCode = 1
323- with nogil:
324- exitCode = CefExecuteProcess(cefMainArgs, cefApp)
325- Debug(" CefExecuteProcess(): exitCode = %s " % exitCode)
326- if exitCode >= 0 :
327- sys.exit(exitCode)
305+ cefApp = < CefRefPtr[CefApp]?> new CefPythonApp()
306+ IF UNAME_SYSNAME == " Windows" :
307+ cdef HINSTANCE hInstance = GetModuleHandle(NULL )
308+ cdef CefMainArgs cefMainArgs = CefMainArgs(hInstance)
309+ ELIF UNAME_SYSNAME == " Linux" :
310+ # TODO: use the CefMainArgs(int argc, char** argv) constructor.
311+ cdef CefMainArgs cefMainArgs
312+ ELIF UNAME_SYSNAME == " Darwin" :
313+ # TODO: use the CefMainArgs(int argc, char** argv) constructor.
314+ cdef CefMainArgs cefMainArgs
315+ cdef int exitCode = 1
316+ with nogil:
317+ exitCode = CefExecuteProcess(cefMainArgs, cefApp)
318+ Debug(" CefExecuteProcess(): exitCode = %s " % exitCode)
319+ if exitCode >= 0 :
320+ sys.exit(exitCode)
328321
329322 # Make a copy as applicationSettings is a reference only
330323 # that might get destroyed later.
@@ -345,12 +338,8 @@ def Initialize(applicationSettings=None, commandLineSwitches=None):
345338
346339 Debug(" CefInitialize()" )
347340 cdef cpp_bool ret
348- IF CEF_VERSION == 1 :
349- with nogil:
350- ret = CefInitialize(cefApplicationSettings, cefApp)
351- ELIF CEF_VERSION == 3 :
352- with nogil:
353- ret = CefInitialize(cefMainArgs, cefApplicationSettings, cefApp)
341+ with nogil:
342+ ret = CefInitialize(cefMainArgs, cefApplicationSettings, cefApp)
354343
355344 if not ret:
356345 Debug(" CefInitialize() failed" )
@@ -421,13 +410,6 @@ def CreateBrowserSync(windowInfo, browserSettings, navigateUrl, requestContext=N
421410 cdef PyBrowser pyBrowser = GetPyBrowser(cefBrowser)
422411 pyBrowser.SetUserData(" __outerWindowHandle" , int (windowInfo.parentWindowHandle))
423412
424- # IF CEF_VERSION == 3:
425- # Test whether process message sent before renderer thread is created
426- # will be delivered - OK.
427- # Debug("Sending 'CreateBrowserSync() done' message to the Renderer")
428- # pyBrowser.SendProcessMessage(cef_types.PID_RENDERER,
429- # "CreateBrowserSync() done")
430-
431413 return pyBrowser
432414
433415def MessageLoop ():
0 commit comments