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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.cc

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 | « chrome/browser/autocomplete/autocomplete_edit_view_win.h ('k') | views/controls/native_control_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_win.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index e853c85dd51c24cf371d254d679f8ba5b382a533..b76a2b5a7e526657cc432a1b8ac92db17cfc4f70 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -22,6 +22,7 @@
#include "app/win/drag_source.h"
#include "app/win/drop_target.h"
#include "app/win/iat_patch_function.h"
+#include "app/win/scoped_prop.h"
#include "base/auto_reset.h"
#include "base/basictypes.h"
#include "base/i18n/rtl.h"
@@ -438,6 +439,10 @@ AutocompleteEditViewWin::AutocompleteEditViewWin(
SendMessage(m_hWnd, EM_SETWORDBREAKPROC, 0,
reinterpret_cast<LPARAM>(&WordBreakProc));
+ // Makes it EN_SELCHANGE is sent to our parent window and back to us by way of
+ // ProcessWindowMessage.
+ SetEventMask(ENM_SELCHANGE);
+
// Get the metrics for the font.
HDC dc = ::GetDC(NULL);
SelectObject(dc, font_.GetNativeFont());
@@ -468,6 +473,9 @@ AutocompleteEditViewWin::AutocompleteEditViewWin(
SetBackgroundColor(background_color_);
+ message_handler_prop_.reset(
+ views::ChildWindowMessageProcessor::Register(m_hWnd, this));
+
// By default RichEdit has a drop target. Revoke it so that we can install our
// own. Revoke takes care of deleting the existing one.
RevokeDragDrop(m_hWnd);
@@ -1056,6 +1064,19 @@ void AutocompleteEditViewWin::ExecuteCommand(int command_id) {
OnAfterPossibleChange();
}
+bool AutocompleteEditViewWin::ProcessMessage(UINT message,
+ WPARAM w_param,
+ LPARAM l_param,
+ LRESULT* result) {
+ if (message == WM_NOTIFY) {
+ NMHDR* header = reinterpret_cast<NMHDR*>(l_param);
+ if (header->code == EN_SELCHANGE) {
+ // TODO(sky): wire this up.
+ }
+ }
+ return false;
+}
+
// static
int CALLBACK AutocompleteEditViewWin::WordBreakProc(LPTSTR edit_text,
int current_pos,
@@ -1246,6 +1267,10 @@ void AutocompleteEditViewWin::OnCut() {
ReplaceSel(L"", true);
}
+void AutocompleteEditViewWin::OnDestroy() {
+ message_handler_prop_.reset();
+}
+
LRESULT AutocompleteEditViewWin::OnGetObject(UINT uMsg,
WPARAM wparam,
LPARAM lparam) {
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_win.h ('k') | views/controls/native_control_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698