Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(821)

Unified Diff: components/browser_watcher/endsession_watcher_window_win.h

Issue 843113002: EndSessionWatcherWindow implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge ToT. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/browser_watcher.gypi ('k') | components/browser_watcher/endsession_watcher_window_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_watcher/endsession_watcher_window_win.h
diff --git a/components/browser_watcher/endsession_watcher_window_win.h b/components/browser_watcher/endsession_watcher_window_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..72bd96c7bbc6fa972b05dd5b39e66de07567e41a
--- /dev/null
+++ b/components/browser_watcher/endsession_watcher_window_win.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2015 The Chromium 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 COMPONENTS_BROWSER_WATCHER_ENDSESSION_WATCHER_WINDOW_WIN_H_
+#define COMPONENTS_BROWSER_WATCHER_ENDSESSION_WATCHER_WINDOW_WIN_H_
+
+#include <windows.h>
+
+#include "base/callback.h"
+#include "base/macros.h"
+
+namespace browser_watcher {
+
+class EndSessionWatcherWindow {
+ public:
+ typedef base::Callback<void(LPARAM)> EndSessionCallback;
+
+ explicit EndSessionWatcherWindow(const EndSessionCallback& on_end_session);
+ virtual ~EndSessionWatcherWindow();
+
+ // Exposed for testing.
+ HWND window() const { return window_; }
+
+ private:
+ LRESULT OnEndSession(WPARAM wparam, LPARAM lparam);
+
+ LRESULT WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
+
+ static LRESULT CALLBACK WndProcThunk(HWND hwnd,
+ UINT message,
+ WPARAM wparam,
+ LPARAM lparam);
+
+ HMODULE instance_;
+ HWND window_;
+
+ EndSessionCallback on_end_session_;
+
+ DISALLOW_COPY_AND_ASSIGN(EndSessionWatcherWindow);
+};
+
+} // namespace browser_watcher
+
+#endif // COMPONENTS_BROWSER_WATCHER_ENDSESSION_WATCHER_WINDOW_WIN_H_
« no previous file with comments | « components/browser_watcher.gypi ('k') | components/browser_watcher/endsession_watcher_window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698