Skip to content

Commit 2fb1b75

Browse files
committed
Updated CEF3 to Chrome 29.0.1547.80 CEF rev. 1491.
1 parent 0a84fae commit 2fb1b75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1885
-927
lines changed

cefpython/browser.pyx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,15 @@ cdef class PyBrowser:
299299
cpdef py_void CloseDevTools(self):
300300
self.GetCefBrowser().get().CloseDevTools()
301301

302-
cpdef py_void Find(self, int searchId, py_string searchText,
303-
py_bool forward, py_bool matchCase,
304-
py_bool findNext):
305-
cdef CefString cefSearchText
306-
PyToCefString(searchText, cefSearchText)
302+
cpdef py_void Find(self, int searchId, py_string searchText,
303+
py_bool forward, py_bool matchCase,
304+
py_bool findNext):
305+
cdef CefString cefSearchText
306+
PyToCefString(searchText, cefSearchText)
307+
IF CEF_VERSION == 3:
308+
self.GetCefBrowserHost().get().Find(searchId, cefSearchText,
309+
bool(forward), bool(matchCase), bool(findNext))
310+
ELIF CEF_VERSION == 1:
307311
self.GetCefBrowser().get().Find(searchId, cefSearchText,
308312
bool(forward), bool(matchCase), bool(findNext))
309313

@@ -425,6 +429,10 @@ cdef class PyBrowser:
425429
cpdef py_void Navigate(self, py_string url):
426430
self.GetMainFrame().LoadUrl(url)
427431

432+
IF CEF_VERSION == 3:
433+
cpdef py_void Print(self):
434+
self.GetCefBrowserHost().get().Print()
435+
428436
cpdef py_void Reload(self):
429437
self.GetCefBrowser().get().Reload()
430438

@@ -454,9 +462,10 @@ cdef class PyBrowser:
454462
cpdef py_void StopLoad(self):
455463
self.GetCefBrowser().get().StopLoad()
456464

457-
IF CEF_VERSION == 1:
458-
459-
cpdef py_void StopFinding(self, py_bool clearSelection):
465+
cpdef py_void StopFinding(self, py_bool clearSelection):
466+
IF CEF_VERSION == 3:
467+
self.GetCefBrowserHost().get().StopFinding(bool(clearSelection))
468+
ELIF CEF_VERSION == 1:
460469
self.GetCefBrowser().get().StopFinding(bool(clearSelection))
461470

462471
cpdef py_void ToggleFullscreen(self):

cefpython/cef3/BUILD_COMPATIBILITY.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Chromium/CEF branch:
2-
1453
2+
1547
33
Chromium release url:
4-
http://src.chromium.org/svn/releases/27.0.1453.116
4+
http://src.chromium.org/svn/releases/29.0.1547.80
55
CEF revision:
6-
1352
6+
1491
77
CEF repository url:
8-
http://chromiumembedded.googlecode.com/svn/branches/1453/cef3@1352
8+
http://chromiumembedded.googlecode.com/svn/branches/1547/cef3@1491
99

1010
----
1111

cefpython/cef3/client_handler/client_handler.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,26 @@ bool ClientHandler::OnKeyEvent(CefRefPtr<CefBrowser> browser,
349349
// methods of this class will be called on the thread indicated.
350350
///
351351

352+
///
353+
// Called on the UI thread before browser navigation. Return true to cancel
354+
// the navigation or false to allow the navigation to proceed. The |request|
355+
// object cannot be modified in this callback.
356+
// CefDisplayHandler::OnLoadingStateChange will be called twice in all cases.
357+
// If the navigation is allowed CefLoadHandler::OnLoadStart and
358+
// CefLoadHandler::OnLoadEnd will be called. If the navigation is canceled
359+
// CefLoadHandler::OnLoadError will be called with an |errorCode| value of
360+
// ERR_ABORTED.
361+
///
362+
/*--cef()--*/
363+
bool ClientHandler::OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
364+
CefRefPtr<CefFrame> frame,
365+
CefRefPtr<CefRequest> request,
366+
bool is_redirect) {
367+
// Not yet implemented.
368+
REQUIRE_UI_THREAD();
369+
return false;
370+
}
371+
352372
///
353373
// Called on the IO thread before a resource request is loaded. The |request|
354374
// object may be modified. To cancel the request return true otherwise return

cefpython/cef3/client_handler/client_handler.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,22 @@ class ClientHandler :
366366
// methods of this class will be called on the thread indicated.
367367
///
368368

369+
///
370+
// Called on the UI thread before browser navigation. Return true to cancel
371+
// the navigation or false to allow the navigation to proceed. The |request|
372+
// object cannot be modified in this callback.
373+
// CefDisplayHandler::OnLoadingStateChange will be called twice in all cases.
374+
// If the navigation is allowed CefLoadHandler::OnLoadStart and
375+
// CefLoadHandler::OnLoadEnd will be called. If the navigation is canceled
376+
// CefLoadHandler::OnLoadError will be called with an |errorCode| value of
377+
// ERR_ABORTED.
378+
///
379+
/*--cef()--*/
380+
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
381+
CefRefPtr<CefFrame> frame,
382+
CefRefPtr<CefRequest> request,
383+
bool is_redirect) OVERRIDE;
384+
369385
///
370386
// Called on the IO thread before a resource request is loaded. The |request|
371387
// object may be modified. To cancel the request return true otherwise return

cefpython/cef3/client_handler/web_request_client.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,22 @@ void WebRequestClient::OnDownloadData(CefRefPtr<CefURLRequest> request,
5757
size_t data_length) {
5858
WebRequestClient_OnDownloadData(webRequestId_, request, data, data_length);
5959
}
60+
61+
///
62+
// Called on the IO thread when the browser needs credentials from the user.
63+
// |isProxy| indicates whether the host is a proxy server. |host| contains the
64+
// hostname and |port| contains the port number. Return true to continue the
65+
// request and call CefAuthCallback::Continue() when the authentication
66+
// information is available. Return false to cancel the request. This method
67+
// will only be called for requests initiated from the browser process.
68+
///
69+
/*--cef(optional_param=realm)--*/
70+
bool WebRequestClient::GetAuthCredentials(bool isProxy,
71+
const CefString& host,
72+
int port,
73+
const CefString& realm,
74+
const CefString& scheme,
75+
CefRefPtr<CefAuthCallback> callback) {
76+
// Not yet implemented.
77+
return false;
78+
}

cefpython/cef3/client_handler/web_request_client.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ class WebRequestClient : public CefURLRequestClient
6565
const void* data,
6666
size_t data_length) OVERRIDE;
6767

68+
///
69+
// Called on the IO thread when the browser needs credentials from the user.
70+
// |isProxy| indicates whether the host is a proxy server. |host| contains the
71+
// hostname and |port| contains the port number. Return true to continue the
72+
// request and call CefAuthCallback::Continue() when the authentication
73+
// information is available. Return false to cancel the request. This method
74+
// will only be called for requests initiated from the browser process.
75+
///
76+
/*--cef(optional_param=realm)--*/
77+
virtual bool GetAuthCredentials(bool isProxy,
78+
const CefString& host,
79+
int port,
80+
const CefString& realm,
81+
const CefString& scheme,
82+
CefRefPtr<CefAuthCallback> callback) OVERRIDE;
83+
6884
protected:
6985
// Include the default reference counting implementation.
7086
IMPLEMENT_REFCOUNTING(WebRequestClient);

cefpython/cef3/include/cef_app.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ void CefRunMessageLoop();
107107
/*--cef()--*/
108108
void CefQuitMessageLoop();
109109

110+
///
111+
// Set to true before calling Windows APIs like TrackPopupMenu that enter a
112+
// modal message loop. Set to false after exiting the modal message loop.
113+
///
114+
/*--cef()--*/
115+
void CefSetOSModalLoop(bool osModalLoop);
116+
110117
///
111118
// Implement this interface to provide handler implementations. Methods will be
112119
// called by the process and/or thread indicated.

cefpython/cef3/include/cef_application_mac.h

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,27 @@
3737

3838
#ifdef BUILDING_CEF_SHARED
3939

40-
// Use the existing CrAppProtocol definition.
41-
#import "base/message_pump_mac.h"
42-
4340
// Use the existing CrAppControlProtocol definition.
4441
#import "base/mac/scoped_sending_event.h"
4542

43+
// Use the existing CrAppProtocol definition.
44+
#import "base/message_loop/message_pump_mac.h"
45+
4646
// Use the existing UnderlayableSurface definition.
4747
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
4848

4949
// Use the existing empty protocol definitions.
5050
#import "base/mac/cocoa_protocols.h"
5151

52+
// Use the existing empty protocol definitions.
53+
#import "base/mac/sdk_forward_declarations.h"
54+
5255
#else // BUILDING_CEF_SHARED
5356

5457
#import <AppKit/AppKit.h>
5558
#import <Cocoa/Cocoa.h>
5659

57-
// Copy of definition from base/message_pump_mac.h.
60+
// Copy of definition from base/message_loop/message_pump_mac.h.
5861
@protocol CrAppProtocol
5962
// Must return true if -[NSApplication sendEvent:] is currently on the stack.
6063
- (BOOL)isHandlingSendEvent;
@@ -72,6 +75,43 @@
7275
@interface UnderlayOpenGLHostingWindow : NSWindow
7376
@end
7477

78+
// Copy of definitions from base/mac/sdk_forward_declarations.h.
79+
// Forward declarations for APIs that are part of the 10.7 SDK. This will allow
80+
// using them when building with the 10.6 SDK.
81+
82+
#if !defined(MAC_OS_X_VERSION_10_7) || \
83+
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
84+
85+
enum {
86+
NSEventPhaseNone = 0, // event not associated with a phase.
87+
NSEventPhaseBegan = 0x1 << 0,
88+
NSEventPhaseStationary = 0x1 << 1,
89+
NSEventPhaseChanged = 0x1 << 2,
90+
NSEventPhaseEnded = 0x1 << 3,
91+
NSEventPhaseCancelled = 0x1 << 4,
92+
};
93+
typedef NSUInteger NSEventPhase;
94+
95+
@interface NSEvent (LionSDK)
96+
+ (BOOL)isSwipeTrackingFromScrollEventsEnabled;
97+
98+
- (NSEventPhase)phase;
99+
- (CGFloat)scrollingDeltaX;
100+
- (CGFloat)scrollingDeltaY;
101+
- (BOOL)isDirectionInvertedFromDevice;
102+
@end
103+
104+
@interface NSScreen (LionSDK)
105+
- (CGFloat)backingScaleFactor;
106+
- (NSRect)convertRectToBacking:(NSRect)aRect;
107+
@end
108+
109+
@interface NSWindow (LionSDK)
110+
- (CGFloat)backingScaleFactor;
111+
@end
112+
113+
#endif // MAC_OS_X_VERSION_10_7
114+
75115
// The Mac OS X 10.6 SDK introduced new protocols used for delegates. These
76116
// protocol defintions were not present in earlier releases of the Mac OS X
77117
// SDK. In order to support building against the new SDK, which requires
@@ -108,6 +148,29 @@ DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
108148

109149
#endif // BUILDING_CEF_SHARED
110150

151+
// Forward declarations for APIs that are part of the 10.7 SDK. This will allow
152+
// using them when building with the 10.6 SDK.
153+
154+
#if !defined(MAC_OS_X_VERSION_10_7) || \
155+
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
156+
157+
@interface NSView (NSOpenGLSurfaceResolutionLionAPI)
158+
- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
159+
@end
160+
161+
@interface NSView (LionAPI)
162+
- (NSSize)convertSizeToBacking:(NSSize)aSize;
163+
- (NSRect)convertRectToBacking:(NSRect)aRect;
164+
- (NSRect)convertRectFromBacking:(NSRect)aRect;
165+
@end
166+
167+
static NSString* const NSWindowDidChangeBackingPropertiesNotification =
168+
@"NSWindowDidChangeBackingPropertiesNotification";
169+
static NSString* const NSBackingPropertyOldScaleFactorKey =
170+
@"NSBackingPropertyOldScaleFactorKey";
171+
172+
#endif // MAC_OS_X_VERSION_10_7
173+
111174
// All CEF client applications must subclass NSApplication and implement this
112175
// protocol.
113176
@protocol CefAppProtocol<CrAppControlProtocol>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright (c) 2013 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+
// ---------------------------------------------------------------------------
31+
//
32+
// The contents of this file must follow a specific format in order to
33+
// support the CEF translator tool. See the translator.README.txt file in the
34+
// tools directory for more information.
35+
//
36+
37+
#ifndef CEF_INCLUDE_CEF_AUTH_CALLBACK_H_
38+
#define CEF_INCLUDE_CEF_AUTH_CALLBACK_H_
39+
#pragma once
40+
41+
#include "include/cef_base.h"
42+
43+
///
44+
// Callback interface used for asynchronous continuation of authentication
45+
// requests.
46+
///
47+
/*--cef(source=library)--*/
48+
class CefAuthCallback : public virtual CefBase {
49+
public:
50+
///
51+
// Continue the authentication request.
52+
///
53+
/*--cef(capi_name=cont)--*/
54+
virtual void Continue(const CefString& username,
55+
const CefString& password) =0;
56+
57+
///
58+
// Cancel the authentication request.
59+
///
60+
/*--cef()--*/
61+
virtual void Cancel() =0;
62+
};
63+
64+
#endif // CEF_INCLUDE_CEF_AUTH_CALLBACK_H_

cefpython/cef3/include/cef_browser.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,29 @@ class CefBrowserHost : public virtual CefBase {
353353
/*--cef()--*/
354354
virtual void StartDownload(const CefString& url) =0;
355355

356+
///
357+
// Print the current browser contents.
358+
///
359+
/*--cef()--*/
360+
virtual void Print() =0;
361+
362+
///
363+
// Search for |searchText|. |identifier| can be used to have multiple searches
364+
// running simultaniously. |forward| indicates whether to search forward or
365+
// backward within the page. |matchCase| indicates whether the search should
366+
// be case-sensitive. |findNext| indicates whether this is the first request
367+
// or a follow-up.
368+
///
369+
/*--cef()--*/
370+
virtual void Find(int identifier, const CefString& searchText,
371+
bool forward, bool matchCase, bool findNext) =0;
372+
373+
///
374+
// Cancel all searches that are currently going on.
375+
///
376+
/*--cef()--*/
377+
virtual void StopFinding(bool clearSelection) =0;
378+
356379
///
357380
// Set whether mouse cursor change is disabled.
358381
///

0 commit comments

Comments
 (0)