cef/tests/cefclient/browser/client_prefs.h
Marshall Greenblatt 882bc19fdd 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.
2022-10-28 14:28:53 -04:00

30 lines
967 B
C++

// Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_PREFS_H_
#define CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_PREFS_H_
#pragma once
#include <optional>
#include "include/cef_base.h"
#include "include/cef_preference.h"
namespace client {
namespace prefs {
// Register global preferences with default values.
void RegisterGlobalPreferences(CefRawPtr<CefPreferenceRegistrar> registrar);
// Load/save window restore info.
bool LoadWindowRestorePreferences(cef_show_state_t& show_state,
std::optional<CefRect>& dip_bounds);
bool SaveWindowRestorePreferences(cef_show_state_t show_state,
std::optional<CefRect> dip_bounds);
} // namespace prefs
} // namespace client
#endif // CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_PREFS_H_