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

Unified Diff: views/widget/child_window_message_processor.h

Issue 4637002: Adds the ability for classes other than native control to process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Tweaks Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/views.gyp ('k') | views/widget/child_window_message_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/child_window_message_processor.h
diff --git a/views/widget/child_window_message_processor.h b/views/widget/child_window_message_processor.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d4e63e26f96f1d897c81428a8f159abe98d6b0d
--- /dev/null
+++ b/views/widget/child_window_message_processor.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef VIEWS_WIDGET_CHILD_WINDOW_MESSAGE_PROCESSOR_H_
+#define VIEWS_WIDGET_CHILD_WINDOW_MESSAGE_PROCESSOR_H_
+#pragma once
+
+#include <windows.h>
+
+namespace app {
+namespace win {
+class ScopedProp;
+}
+}
+
+namespace views {
+
+// Windows sends a handful of messages to the parent window rather than the
+// window itself. For example, selection changes of a rich edit (EN_SELCHANGE)
+// are sent to the parent, not the window. Typically such message are best
+// dealt with by the window rather than the parent. WidgetWin allows for
+// registering a ChildWindowMessageProcessor to handle such messages.
+class ChildWindowMessageProcessor {
+ public:
+ // Registers |processor| for |hwnd|. The caller takes ownership of the
+ // returned object.
+ static app::win::ScopedProp* Register(HWND hwnd,
+ ChildWindowMessageProcessor* processor);
+
+ // Returns the ChildWindowMessageProcessor for |hwnd|, NULL if there isn't
+ // one.
+ static ChildWindowMessageProcessor* Get(HWND hwnd);
+
+ // Invoked for any messages that are sent to the parent and originated from
+ // the HWND this ChildWindowMessageProcessor was registered for. Returns true
+ // if the message was handled with a valid result in |result|. Returns false
+ // if the message was not handled.
+ virtual bool ProcessMessage(UINT message,
+ WPARAM w_param,
+ LPARAM l_param,
+ LRESULT* result) = 0;
+
+ protected:
+ virtual ~ChildWindowMessageProcessor() {}
+};
+
+} // namespace views
+
+#endif // VIEWS_WIDGET_CHILD_WINDOW_MESSAGE_PROCESSOR_H_
« no previous file with comments | « views/views.gyp ('k') | views/widget/child_window_message_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698