cefclient: win: Support window state restore (see issue #3359)

The cefclient sample app on Windows will persist window state across application
restart if run with cache_path and persist_user_references enabled.

To test:
1. Run `cefclient --cache-path=/path/to/cache --persist-user-preferences`
2. Move or resize the window, maximize, minimize, etc.
3. Exit cefclient.
4. Run cefclient again with the same arguments. The previous window state will
   be restored.
This commit is contained in:
Marshall Greenblatt
2022-11-07 15:21:44 -05:00
parent 882bc19fdd
commit e2a9236106
13 changed files with 310 additions and 94 deletions

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=5e68fdaae42fe008a95bcf2672debe3cf04fa2ff$
// $hash=d2f3054a54f514ce650101e293bf085eeba48ee7$
//
#include "libcef_dll/cpptoc/views/display_cpptoc.h"
@ -163,6 +163,48 @@ cef_display_convert_screen_point_from_pixels(const cef_point_t* point) {
return _retval;
}
CEF_EXPORT cef_rect_t
cef_display_convert_screen_rect_to_pixels(const cef_rect_t* rect) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: rect; type: simple_byref_const
DCHECK(rect);
if (!rect)
return CefRect();
// Translate param: rect; type: simple_byref_const
CefRect rectVal = rect ? *rect : CefRect();
// Execute
cef_rect_t _retval = CefDisplay::ConvertScreenRectToPixels(rectVal);
// Return type: simple
return _retval;
}
CEF_EXPORT cef_rect_t
cef_display_convert_screen_rect_from_pixels(const cef_rect_t* rect) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: rect; type: simple_byref_const
DCHECK(rect);
if (!rect)
return CefRect();
// Translate param: rect; type: simple_byref_const
CefRect rectVal = rect ? *rect : CefRect();
// Execute
cef_rect_t _retval = CefDisplay::ConvertScreenRectFromPixels(rectVal);
// Return type: simple
return _retval;
}
namespace {
// MEMBER FUNCTIONS - Body may be edited by hand.