mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Standardize fullscreen transition behavor/callbacks (fixes #3571)
Use the same code path for all fullscreen transitions so that Chrome UI updates correctly. All user-initiated fullscreen transitions now result in CefWindowDelegate::OnWindowFullscreenTransition callbacks.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=1de3354bd0a042cc28199f1f56753b1df9e279a2$
|
||||
// $hash=5374127458a7cac3ee9b4d2b4ad8a6f5ca81ec52$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_
|
||||
@@ -84,8 +84,13 @@ typedef struct _cef_display_handler_t {
|
||||
/// Called when web content in the page has toggled fullscreen mode. If
|
||||
/// |fullscreen| is true (1) the content will automatically be sized to fill
|
||||
/// the browser content area. If |fullscreen| is false (0) the content will
|
||||
/// automatically return to its original size and position. The client is
|
||||
/// responsible for resizing the browser if desired.
|
||||
/// automatically return to its original size and position. With the Alloy
|
||||
/// runtime the client is responsible for triggering the fullscreen transition
|
||||
/// (for example, by calling cef_window_t::SetFullscreen when using Views).
|
||||
/// With the Chrome runtime the fullscreen transition will be triggered
|
||||
/// automatically. The cef_window_delegate_t::OnWindowFullscreenTransition
|
||||
/// function will be called during the fullscreen transition for notification
|
||||
/// purposes.
|
||||
///
|
||||
void(CEF_CALLBACK* on_fullscreen_mode_change)(
|
||||
struct _cef_display_handler_t* self,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=d53c4a0a7e731a56a0edcb9d705c76b0a2770155$
|
||||
// $hash=4b43fe0b493d860e8b28d7a6d892db49d1135b34$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_CAPI_H_
|
||||
@@ -155,7 +155,9 @@ typedef struct _cef_window_t {
|
||||
void(CEF_CALLBACK* restore)(struct _cef_window_t* self);
|
||||
|
||||
///
|
||||
/// Set fullscreen Window state.
|
||||
/// Set fullscreen Window state. The
|
||||
/// cef_window_delegate_t::OnWindowFullscreenTransition function will be
|
||||
/// called during the fullscreen transition for notification purposes.
|
||||
///
|
||||
void(CEF_CALLBACK* set_fullscreen)(struct _cef_window_t* self,
|
||||
int fullscreen);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=61099a1ba8b16a5e46f5a80d326d1f9bfc99317d$
|
||||
// $hash=456f00f7afbac910cf36feecd38399a2fb16960d$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
||||
@@ -96,6 +96,20 @@ typedef struct _cef_window_delegate_t {
|
||||
struct _cef_window_t* window,
|
||||
const cef_rect_t* new_bounds);
|
||||
|
||||
///
|
||||
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
|
||||
/// the transition occurs asynchronously with |is_competed| set to false (0)
|
||||
/// when the transition starts and true (1) after the transition completes. On
|
||||
/// other platforms the transition occurs synchronously with |is_completed|
|
||||
/// set to true (1) after the transition completes. With the Alloy runtime you
|
||||
/// must also implement cef_display_handler_t::OnFullscreenModeChange to
|
||||
/// handle fullscreen transitions initiated by browser content.
|
||||
///
|
||||
void(CEF_CALLBACK* on_window_fullscreen_transition)(
|
||||
struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window,
|
||||
int is_completed);
|
||||
|
||||
///
|
||||
/// Return the parent for |window| or NULL if the |window| does not have a
|
||||
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
|
||||
@@ -210,17 +224,6 @@ typedef struct _cef_window_delegate_t {
|
||||
int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window,
|
||||
const cef_key_event_t* event);
|
||||
|
||||
///
|
||||
/// Called when the |window| is transitioning to or from fullscreen mode. The
|
||||
/// transition occurs in two stages, with |is_competed| set to false (0) when
|
||||
/// the transition starts and true (1) when the transition completes. This
|
||||
/// function is only supported on macOS.
|
||||
///
|
||||
void(CEF_CALLBACK* on_window_fullscreen_transition)(
|
||||
struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window,
|
||||
int is_completed);
|
||||
} cef_window_delegate_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -42,13 +42,13 @@
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "8aa786740cdcadf7b4f6dd3554343abae09ffdfd"
|
||||
#define CEF_API_HASH_UNIVERSAL "c684c3da478cb88b042bf13c88ab7797e33c29bc"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "f241d73d66f3b7f99aae58a0cc99be36beda4f4f"
|
||||
#define CEF_API_HASH_PLATFORM "bcc26a8181330fd0dc07e9d2475c048919d4f55f"
|
||||
#elif defined(OS_MAC)
|
||||
#define CEF_API_HASH_PLATFORM "3708f34f956e6306d09989a88ff1dee9c8f7a2b5"
|
||||
#define CEF_API_HASH_PLATFORM "2abec7e306f2c474c8a66b585b9c6a0bdcd45276"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "cf413edb4edeb80d7d5c1173e342231b26808fce"
|
||||
#define CEF_API_HASH_PLATFORM "b93f84208be4af554a5b60315a63251263a71e57"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -75,8 +75,12 @@ class CefDisplayHandler : public virtual CefBaseRefCounted {
|
||||
/// Called when web content in the page has toggled fullscreen mode. If
|
||||
/// |fullscreen| is true the content will automatically be sized to fill the
|
||||
/// browser content area. If |fullscreen| is false the content will
|
||||
/// automatically return to its original size and position. The client is
|
||||
/// responsible for resizing the browser if desired.
|
||||
/// automatically return to its original size and position. With the Alloy
|
||||
/// runtime the client is responsible for triggering the fullscreen transition
|
||||
/// (for example, by calling CefWindow::SetFullscreen when using Views). With
|
||||
/// the Chrome runtime the fullscreen transition will be triggered
|
||||
/// automatically. The CefWindowDelegate::OnWindowFullscreenTransition method
|
||||
/// will be called during the fullscreen transition for notification purposes.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnFullscreenModeChange(CefRefPtr<CefBrowser> browser,
|
||||
|
@@ -165,7 +165,9 @@ class CefWindow : public CefPanel {
|
||||
virtual void Restore() = 0;
|
||||
|
||||
///
|
||||
/// Set fullscreen Window state.
|
||||
/// Set fullscreen Window state. The
|
||||
/// CefWindowDelegate::OnWindowFullscreenTransition method will be called
|
||||
/// during the fullscreen transition for notification purposes.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void SetFullscreen(bool fullscreen) = 0;
|
||||
|
@@ -84,6 +84,19 @@ class CefWindowDelegate : public CefPanelDelegate {
|
||||
virtual void OnWindowBoundsChanged(CefRefPtr<CefWindow> window,
|
||||
const CefRect& new_bounds) {}
|
||||
|
||||
///
|
||||
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
|
||||
/// the transition occurs asynchronously with |is_competed| set to false when
|
||||
/// the transition starts and true after the transition completes. On other
|
||||
/// platforms the transition occurs synchronously with |is_completed| set to
|
||||
/// true after the transition completes. With the Alloy runtime you must also
|
||||
/// implement CefDisplayHandler::OnFullscreenModeChange to handle fullscreen
|
||||
/// transitions initiated by browser content.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
|
||||
bool is_completed) {}
|
||||
|
||||
///
|
||||
/// Return the parent for |window| or NULL if the |window| does not have a
|
||||
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
|
||||
@@ -209,16 +222,6 @@ class CefWindowDelegate : public CefPanelDelegate {
|
||||
const CefKeyEvent& event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
/// Called when the |window| is transitioning to or from fullscreen mode. The
|
||||
/// transition occurs in two stages, with |is_competed| set to false when the
|
||||
/// transition starts and true when the transition completes.
|
||||
/// This method is only supported on macOS.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
|
||||
bool is_completed) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_
|
||||
|
Reference in New Issue
Block a user