Screen Lock / Unlock events (#12714)

* initial lock-screen and unlock-screen event implementation for macOS

* Implementation of lock-screen and unlock-screen on windows
This commit is contained in:
Samuel Attard 2018-05-01 02:04:27 +10:00 committed by GitHub
parent c1381ac598
commit 338a816ffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 187 additions and 0 deletions

View file

@ -36,6 +36,10 @@ class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
void UnblockShutdown();
#endif
#if defined(OS_MACOSX) || defined(OS_WIN)
void InitPlatformSpecificMonitors();
#endif
// base::PowerObserver implementations:
void OnPowerStateChange(bool on_battery_power) override;
void OnSuspend() override;
@ -47,6 +51,28 @@ class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
const ui::IdleCallback& callback);
void QuerySystemIdleTime(const ui::IdleTimeCallback& callback);
#if defined(OS_WIN)
// Static callback invoked when a message comes in to our messaging window.
static LRESULT CALLBACK WndProcStatic(HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam);
LRESULT CALLBACK WndProc(HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam);
// The window class of |window_|.
ATOM atom_;
// The handle of the module that contains the window procedure of |window_|.
HMODULE instance_;
// The window used for processing events.
HWND window_;
#endif
DISALLOW_COPY_AND_ASSIGN(PowerMonitor);
};