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

Side by Side Diff: ui/base/win/singleton_hwnd.h

Issue 9359019: Split the singleton hwnd from screen_compatible_dc_win.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/win/singleton_hwnd.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 #ifndef UI_BASE_SINGLETON_HWND_H_
tfarina 2012/02/08 23:35:50 still wrong :) UI_BASE_SINGLETON_HWND_H_ -> UI_BAS
Alexei Svitkine (slow) 2012/02/09 15:11:43 Oops, you're right. Fixed.
6 #define UI_BASE_SINGLETON_HWND_H_
7 #pragma once
8
9 #include <windows.h>
10 #include <vector>
11
12 #include "base/basictypes.h"
13 #include "base/callback_forward.h"
14 #include "base/memory/singleton.h"
15
16 namespace ui {
17
18 typedef base::Callback<void(HWND, UINT, WPARAM, LPARAM)> WndProcCallback;
19
20 // Singleton HWND that allows interested clients to receive WM_* notifications.
21 class SingletonHwnd {
22 public:
23 // Singleton getter.
24 static SingletonHwnd* GetInstance();
25
26 // Registers a listener callback for WM_* notifications.
27 void RegisterListener(WndProcCallback& callback);
28
29 // Windows callback for WM_* notifications.
30 void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
31
32 private:
33 // Listener HWND for WM_* notifications.
34 HWND listener_window_;
35
36 // List of registered listener callbacks.
37 std::vector<WndProcCallback> listeners_;
38
39 SingletonHwnd();
sky 2012/02/08 23:34:04 this should be first.
Alexei Svitkine (slow) 2012/02/09 15:11:43 Done.
40 ~SingletonHwnd();
41
42 friend struct DefaultSingletonTraits<SingletonHwnd>;
43
44 DISALLOW_COPY_AND_ASSIGN(SingletonHwnd);
45 };
46
47 } // namespace ui
48
49 #endif // UI_BASE_SINGLETON_HWND_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/win/singleton_hwnd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698