@@ -18,10 +18,12 @@ IF CEF_VERSION == 1:
1818
1919cdef dict g_pyBrowsers = {}
2020
21- cdef PyBrowser GetPyBrowserById(int browserId):
22- if g_pyBrowsers.has_key(browserId):
23- return g_pyBrowsers[browserId]
24- return None
21+ IF CEF_VERSION == 3 :
22+ # Unused function warning in CEF 1.
23+ cdef PyBrowser GetPyBrowserById(int browserId):
24+ if g_pyBrowsers.has_key(browserId):
25+ return g_pyBrowsers[browserId]
26+ return None
2527
2628cdef PyBrowser GetPyBrowser(CefRefPtr[CefBrowser] cefBrowser):
2729 global g_pyBrowsers
@@ -79,16 +81,18 @@ cdef PyBrowser GetPyBrowser(CefRefPtr[CefBrowser] cefBrowser):
7981 pyBrowser.SetJavascriptBindings(javascriptBindings)
8082 return pyBrowser
8183
82- cdef void RemovePyBrowser(int browserId) except * :
83- # Called from LifespanHandler_OnBeforeClose().
84- # TODO: call this function also in CEF 1, currently called only in CEF 3.
85- global g_pyBrowsers
86- if g_pyBrowsers.has_key(browserId):
87- Debug(" del g_pyBrowsers[%s ]" % browserId)
88- del g_pyBrowsers[browserId]
89- else :
90- Debug(" RemovePyBrowser() FAILED: browser not found, id = %s " \
91- % browserId)
84+ IF CEF_VERSION == 3 :
85+ # Unused function warning in CEF 1.
86+ cdef void RemovePyBrowser(int browserId) except * :
87+ # Called from LifespanHandler_OnBeforeClose().
88+ # TODO: call this function also in CEF 1.
89+ global g_pyBrowsers
90+ if g_pyBrowsers.has_key(browserId):
91+ Debug(" del g_pyBrowsers[%s ]" % browserId)
92+ del g_pyBrowsers[browserId]
93+ else :
94+ Debug(" RemovePyBrowser() FAILED: browser not found, id = %s " \
95+ % browserId)
9296
9397cpdef PyBrowser GetBrowserByWindowHandle(WindowHandle windowHandle):
9498 cdef PyBrowser pyBrowser
0 commit comments