#ifndef UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_
#define UI_VIEWS_WIN_FULLSCREEN_HANDLER_H_
#include <shobjidl.h>
#include <wrl/client.h>
#include "base/memory/weak_ptr.h"
namespace gfx {
class Rect;
}
namespace views {
class FullscreenHandler {
public:
FullscreenHandler();
FullscreenHandler(const FullscreenHandler&) = delete;
FullscreenHandler& operator=(const FullscreenHandler&) = delete;
~FullscreenHandler();
void set_hwnd(HWND hwnd) { hwnd_ = hwnd; }
void SetFullscreen(bool fullscreen, int64_t target_display_id);
void MarkFullscreen(bool fullscreen);
gfx::Rect GetRestoreBounds() const;
bool fullscreen() const { return fullscreen_; }
private:
struct SavedWindowInfo {
LONG style;
LONG ex_style;
RECT rect;
int dpi;
HMONITOR monitor;
MONITORINFO monitor_info;
};
void ProcessFullscreen(bool fullscreen, int64_t target_display_id);
HWND hwnd_ = nullptr;
bool fullscreen_ = false;
SavedWindowInfo saved_window_info_;
Microsoft::WRL::ComPtr<ITaskbarList2> task_bar_list_;
base::WeakPtrFactory<FullscreenHandler> weak_ptr_factory_{this};
};
}
#endif