cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / ui / gfx / win / singleton_hwnd_observer.h
bloba1bd52448104c08f29cb06ed412a24dcc7e14079
1 // Copyright 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 UI_GFX_WIN_SINGLETON_HWND_OBSERVER_H_
6 #define UI_GFX_WIN_SINGLETON_HWND_OBSERVER_H_
8 #include <windows.h>
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "ui/gfx/gfx_export.h"
14 namespace gfx {
16 class SingletonHwnd;
18 // Singleton lifetime management is tricky. This observer handles the correct
19 // cleanup if either the SingletonHwnd or forwarded object is destroyed first.
20 class GFX_EXPORT SingletonHwndObserver {
21 public:
22 typedef base::Callback<void(HWND, UINT, WPARAM, LPARAM)> WndProc;
24 explicit SingletonHwndObserver(const WndProc& wnd_proc);
25 ~SingletonHwndObserver();
27 private:
28 friend class SingletonHwnd;
30 void ClearWndProc();
31 void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
33 WndProc wnd_proc_;
35 DISALLOW_COPY_AND_ASSIGN(SingletonHwndObserver);
38 } // namespace gfx
40 #endif // UI_GFX_WIN_SINGLETON_HWND_OBSERVER_H_