1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_BROWSER_WATCHER_ENDSESSION_WATCHER_WINDOW_WIN_H_
6 #define COMPONENTS_BROWSER_WATCHER_ENDSESSION_WATCHER_WINDOW_WIN_H_
10 #include "base/callback.h"
11 #include "base/macros.h"
13 namespace browser_watcher
{
15 class EndSessionWatcherWindow
{
17 typedef base::Callback
<void(UINT
, LPARAM
)> EndSessionMessageCallback
;
19 explicit EndSessionWatcherWindow(
20 const EndSessionMessageCallback
& on_end_session_message
);
21 virtual ~EndSessionWatcherWindow();
23 // Exposed for testing.
24 HWND
window() const { return window_
; }
27 LRESULT
OnEndSessionMessage(UINT message
, WPARAM wparam
, LPARAM lparam
);
29 LRESULT
WndProc(HWND hwnd
, UINT message
, WPARAM wparam
, LPARAM lparam
);
31 static LRESULT CALLBACK
WndProcThunk(HWND hwnd
,
39 EndSessionMessageCallback on_end_session_message_
;
41 DISALLOW_COPY_AND_ASSIGN(EndSessionWatcherWindow
);
44 } // namespace browser_watcher
46 #endif // COMPONENTS_BROWSER_WATCHER_ENDSESSION_WATCHER_WINDOW_WIN_H_