Index: ui/views/win/hwnd_message_handler.cc |
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc |
index 86ed8f889c80ded0c79d1ed9f527dbf932769243..a7d5393be88a2ceb3cfe57b24ccc4cd0dc117c36 100644 |
--- a/ui/views/win/hwnd_message_handler.cc |
+++ b/ui/views/win/hwnd_message_handler.cc |
@@ -14,6 +14,7 @@ |
#include "base/bind_helpers.h" |
#include "base/debug/alias.h" |
#include "base/macros.h" |
+#include "base/strings/string_number_conversions.h" |
#include "base/trace_event/trace_event.h" |
#include "base/win/scoped_gdi_object.h" |
#include "base/win/windows_version.h" |
@@ -928,8 +929,12 @@ LRESULT HWNDMessageHandler::OnWndProc(UINT message, |
delegate_->HandleDestroyed(); |
} |
- if (message == WM_ACTIVATE && IsTopLevelWindow(window)) |
- PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param)); |
+ if (message == WM_ACTIVATE) { |
+ if (IsTopLevelWindow(window)) |
+ PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param)); |
+ else |
+ delegate_->AddLog("WM_ACTIVATE on non-top-level window."); |
+ } |
return result; |
} |
@@ -1033,6 +1038,8 @@ void HWNDMessageHandler::PostProcessActivateMessage(int activation_state, |
const bool active = activation_state != WA_INACTIVE && !minimized; |
if (delegate_->CanActivate()) |
delegate_->HandleActivationChanged(active); |
+ else |
+ delegate_->AddLog("Missing call to HandleActivationChanged."); |
} |
void HWNDMessageHandler::RestoreEnabledIfNecessary() { |
@@ -1231,6 +1238,7 @@ void HWNDMessageHandler::ForceRedrawWindow(int attempts) { |
// Message handlers ------------------------------------------------------------ |
void HWNDMessageHandler::OnActivateApp(BOOL active, DWORD thread_id) { |
+ delegate_->AddLog("WM_ACTIVATEAPP: " + base::IntToString(active)); |
if (delegate_->IsWidgetWindow() && !active && |
thread_id != GetCurrentThreadId()) { |
delegate_->HandleAppDeactivated(); |
@@ -1486,6 +1494,8 @@ void HWNDMessageHandler::OnInputLangChange(DWORD character_set, |
LRESULT HWNDMessageHandler::OnKeyEvent(UINT message, |
WPARAM w_param, |
LPARAM l_param) { |
+ if (message == WM_KEYDOWN || message == WM_SYSKEYDOWN) |
+ delegate_->AddLog("WM_KEYDOWN || WM_SYSKEYDOWN"); |
MSG msg = { |
hwnd(), message, w_param, l_param, static_cast<DWORD>(GetMessageTime())}; |
ui::KeyEvent key(msg); |
@@ -1503,6 +1513,7 @@ void HWNDMessageHandler::OnKillFocus(HWND focused_window) { |
LRESULT HWNDMessageHandler::OnMouseActivate(UINT message, |
WPARAM w_param, |
LPARAM l_param) { |
+ delegate_->AddLog("WM_MOUSEACTIVATE"); |
// Please refer to the comments in the header for the touch_down_contexts_ |
// member for the if statement below. |
if (touch_down_contexts_) |
@@ -1562,6 +1573,7 @@ void HWNDMessageHandler::OnMoving(UINT param, const RECT* new_bounds) { |
LRESULT HWNDMessageHandler::OnNCActivate(UINT message, |
WPARAM w_param, |
LPARAM l_param) { |
+ delegate_->AddLog("WM_NCACTIVATE: " + base::UintToString(w_param)); |
// Per MSDN, w_param is either TRUE or FALSE. However, MSDN also hints that: |
// "If the window is minimized when this message is received, the application |
// should pass the message to the DefWindowProc function." |