Fix build break
[chromium-blink-merge.git] / ui / views / widget / child_window_message_processor.h
blob112d9d835d4dfa3a887b7cb19fe48792d9f50581
1 // Copyright (c) 2011 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_VIEWS_WIDGET_CHILD_WINDOW_MESSAGE_PROCESSOR_H_
6 #define UI_VIEWS_WIDGET_CHILD_WINDOW_MESSAGE_PROCESSOR_H_
8 #include <windows.h>
10 namespace ui {
11 class ViewProp;
14 namespace views {
16 // Windows sends a handful of messages to the parent window rather than the
17 // window itself. For example, selection changes of a rich edit (EN_SELCHANGE)
18 // are sent to the parent, not the window. Typically such message are best
19 // dealt with by the window rather than the parent. NativeWidgetWin allows for
20 // registering a ChildWindowMessageProcessor to handle such messages.
21 class ChildWindowMessageProcessor {
22 public:
23 // Registers |processor| for |hwnd|. The caller takes ownership of the
24 // returned object.
25 static ui::ViewProp* Register(HWND hwnd,
26 ChildWindowMessageProcessor* processor);
28 // Returns the ChildWindowMessageProcessor for |hwnd|, NULL if there isn't
29 // one.
30 static ChildWindowMessageProcessor* Get(HWND hwnd);
32 // Invoked for any messages that are sent to the parent and originated from
33 // the HWND this ChildWindowMessageProcessor was registered for. Returns true
34 // if the message was handled with a valid result in |result|. Returns false
35 // if the message was not handled.
36 virtual bool ProcessMessage(UINT message,
37 WPARAM w_param,
38 LPARAM l_param,
39 LRESULT* result) = 0;
41 protected:
42 virtual ~ChildWindowMessageProcessor() {}
45 } // namespace views
47 #endif // UI_VIEWS_WIDGET_CHILD_WINDOW_MESSAGE_PROCESSOR_H_