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

Side by Side Diff: trunk/src/base/win/message_window.h

Issue 15973003: Revert 201955 "Allow multiple base::MessagePumpForUI instances t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 | « trunk/src/base/message_pump_win.cc ('k') | trunk/src/base/win/message_window.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 2013 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 BASE_WIN_MESSAGE_WINDOW_H_
6 #define BASE_WIN_MESSAGE_WINDOW_H_
7
8 #include <windows.h>
9
10 #include <string>
11
12 #include "base/base_export.h"
13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h"
15 #include "base/threading/non_thread_safe.h"
16
17 namespace base {
18 namespace win {
19
20 // Implements a message-only window.
21 class BASE_EXPORT MessageWindow : base::NonThreadSafe {
22 public:
23 // Handles incoming window messages.
24 class BASE_EXPORT Delegate {
25 public:
26 virtual ~Delegate() {}
27
28 virtual bool HandleMessage(HWND hwnd,
29 UINT message,
30 WPARAM wparam,
31 LPARAM lparam,
32 LRESULT* result) = 0;
33 };
34
35 MessageWindow();
36 ~MessageWindow();
37
38 // Registers the window class and creates the window. The incoming messages
39 // will be handled by |delegate|. |delegate| must outlive |this|.
40 bool Create(Delegate* delegate);
41
42 HWND hwnd() const { return window_; }
43
44 private:
45 // Invoked by the OS to process incoming window messages.
46 static LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wparam,
47 LPARAM lparam);
48
49 // Atom representing the registered window class.
50 ATOM atom_;
51
52 // MessageWindow class name.
53 std::string class_name_;
54
55 // Instance of the module containing the window procedure.
56 HINSTANCE instance_;
57
58 // Handle of the input window.
59 HWND window_;
60
61 DISALLOW_COPY_AND_ASSIGN(MessageWindow);
62 };
63
64 } // namespace win
65 } // namespace base
66
67 #endif // BASE_WIN_MESSAGE_WINDOW_H_
OLDNEW
« no previous file with comments | « trunk/src/base/message_pump_win.cc ('k') | trunk/src/base/win/message_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698