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

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

Issue 9370026: Respect the system ClearType setting in RenderTextWin. (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') | ui/base/win/singleton_hwnd.cc » ('J')
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_WIN_SINGLETON_HWND_H_
6 #define UI_BASE_WIN_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
15 template<typename T> struct DefaultSingletonTraits;
16
17 namespace ui {
18
19 typedef base::Callback<void(HWND, UINT, WPARAM, LPARAM)> WndProcCallback;
20
21 // Singleton message-only HWND that allows interested clients to receive WM_*
22 // notifications.
msw 2012/02/15 00:33:16 Note that not all WM_* messages are supported; poi
asvitkine_google 2012/02/15 15:10:44 Done.
23 class SingletonHwnd {
msw 2012/02/15 00:33:16 Why not use/extend existing code like MessagePumpO
asvitkine_google 2012/02/15 15:10:44 I'm not familiar with that class... from a quick g
msw 2012/02/15 19:23:28 You're creating an HWND to listen for arbitrary WM
24 public:
25 // Singleton getter.
msw 2012/02/15 00:33:16 nit: remove obvious comment.
asvitkine_google 2012/02/15 15:10:44 Done.
26 static SingletonHwnd* GetInstance();
27
28 // Registers a listener callback for WM_* notifications.
msw 2012/02/15 00:33:16 Did you consider using [Add|Remove]Observer termin
asvitkine_google 2012/02/15 15:10:44 You're right - I think base/observer_list.h is the
29 void RegisterListener(const WndProcCallback& callback);
msw 2012/02/15 00:33:16 Is there no way to UnregisterListener?
asvitkine_google 2012/02/15 15:10:44 Added.
30
31 // Windows callback for WM_* notifications.
32 void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
33
34 private:
35 friend struct DefaultSingletonTraits<SingletonHwnd>;
36
37 SingletonHwnd();
38 ~SingletonHwnd();
39
40 // Listener HWND for WM_* notifications.
41 HWND listener_window_;
42
43 // List of registered listener callbacks.
44 std::vector<WndProcCallback> listeners_;
45
46 DISALLOW_COPY_AND_ASSIGN(SingletonHwnd);
47 };
48
49 } // namespace ui
50
51 #endif // UI_BASE_WIN_SINGLETON_HWND_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/win/singleton_hwnd.cc » ('j') | ui/base/win/singleton_hwnd.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698