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

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

To test:
1. Run `cefclient --use-views --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-10-28 14:17:18 -04:00
parent 09bb643ef6
commit 882bc19fdd
18 changed files with 511 additions and 65 deletions

View File

@@ -55,6 +55,12 @@ class CefWindowDelegate : public CefPanelDelegate {
/*--cef()--*/
virtual void OnWindowCreated(CefRefPtr<CefWindow> window) {}
///
/// Called when |window| is closing.
///
/*--cef()--*/
virtual void OnWindowClosing(CefRefPtr<CefWindow> window) {}
///
/// Called when |window| is destroyed. Release all references to |window| and
/// do not attempt to execute any methods on |window| after this callback
@@ -70,6 +76,14 @@ class CefWindowDelegate : public CefPanelDelegate {
virtual void OnWindowActivationChanged(CefRefPtr<CefWindow> window,
bool active) {}
///
/// Called when |window| bounds have changed. |new_bounds| will be in DIP
/// screen coordinates.
///
/*--cef()--*/
virtual void OnWindowBoundsChanged(CefRefPtr<CefWindow> window,
const CefRect& new_bounds) {}
///
/// 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|