views: Support specification of screen bounds for CefWindow creation (fixes issue #2980)

This commit is contained in:
Marshall Greenblatt
2020-09-02 14:25:25 -04:00
parent 4aad5f23a0
commit b579b37db4
10 changed files with 129 additions and 12 deletions

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a0cec778fbaf0b1f5c9b3ef75dc7bbeeba777a44$
// $hash=734a13cd5ad9b0af1b29e1e91b406dd5e6740dc4$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
@@ -87,6 +87,16 @@ typedef struct _cef_window_delegate_t {
int* is_menu,
int* can_activate_menu);
///
// Return the initial bounds for |window| in screen coordinates. If this
// function returns an NULL CefRect then get_preferred_size() will be called
// to retrieve the size, and the window will be placed on the default screen
// with origin (0,0).
///
cef_rect_t(CEF_CALLBACK* get_initial_bounds)(
struct _cef_window_delegate_t* self,
struct _cef_window_t* window);
///
// Return true (1) if |window| should be created without a frame or title bar.
// The window will be resizable if can_resize() returns true (1). Use

View File

@@ -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 "09dba98bcfcdf8a84e6e1bddf9cfbfd02cdb9c41"
#define CEF_API_HASH_UNIVERSAL "09d3d4f08869644fe3baa7a751de537f3446525b"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "52cba70fb6dd7cfa07a64033875f2b9951ab194b"
#define CEF_API_HASH_PLATFORM "3022db6736af26cc38158d38e22f74a51312a5c9"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "40ddb93c4e9b9d0f81b62a61a595307c6ed204e5"
#define CEF_API_HASH_PLATFORM "13e2e2451c2320f0d16b35ba53b3295409888dd8"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "e48b0f06a363df82624951e4b85fb638bf0987c0"
#define CEF_API_HASH_PLATFORM "d781b815150795b0bce95d72ce967b508c9a04d5"
#endif
#ifdef __cplusplus

View File

@@ -78,6 +78,17 @@ class CefWindowDelegate : public CefPanelDelegate {
return nullptr;
}
///
// Return the initial bounds for |window| in screen coordinates. If this
// method returns an empty CefRect then GetPreferredSize() will be called to
// retrieve the size, and the window will be placed on the default screen with
// origin (0,0).
///
/*--cef()--*/
virtual CefRect GetInitialBounds(CefRefPtr<CefWindow> window) {
return CefRect();
}
///
// Return true if |window| should be created without a frame or title bar. The
// window will be resizable if CanResize() returns true. Use