Index: ui/platform_window/win/win_window.cc |
diff --git a/ui/platform_window/win/win_window.cc b/ui/platform_window/win/win_window.cc |
index 51db7e71604c4d37e346f320f1e5ca2bfd9feb6e..a3e9ba1b117c6f33aa412f44ccfc4fcc24620f5d 100644 |
--- a/ui/platform_window/win/win_window.cc |
+++ b/ui/platform_window/win/win_window.cc |
@@ -13,6 +13,8 @@ namespace ui { |
namespace { |
+bool use_popup_as_root_window_for_test = false; |
+ |
gfx::Rect GetWindowBoundsForClientBounds(DWORD style, DWORD ex_style, |
const gfx::Rect& bounds) { |
RECT wr; |
@@ -37,6 +39,8 @@ WinWindow::WinWindow(PlatformWindowDelegate* delegate, |
const gfx::Rect& bounds) |
: delegate_(delegate) { |
CHECK(delegate_); |
+ if (use_popup_as_root_window_for_test) |
+ set_window_style(WS_POPUP); |
gfx::Rect window_bounds = GetWindowBoundsForClientBounds( |
WS_OVERLAPPEDWINDOW, window_ex_style(), bounds); |
gfx::WindowImpl::Init(NULL, window_bounds); |
@@ -125,6 +129,7 @@ LRESULT WinWindow::OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param) { |
} |
LRESULT WinWindow::OnNCActivate(UINT message, WPARAM w_param, LPARAM l_param) { |
+ delegate_->OnActivationChanged(!!w_param); |
return DefWindowProc(hwnd(), message, w_param, l_param); |
} |
@@ -147,6 +152,7 @@ void WinWindow::OnPaint(HDC) { |
if (GetUpdateRect(hwnd(), &update_rect, FALSE)) |
damage_rect = gfx::Rect(update_rect); |
delegate_->OnDamageRect(damage_rect); |
+ ValidateRect(hwnd(), NULL); |
} |
void WinWindow::OnWindowPosChanged(WINDOWPOS* window_pos) { |
@@ -160,4 +166,13 @@ void WinWindow::OnWindowPosChanged(WINDOWPOS* window_pos) { |
} |
} |
+namespace test { |
+ |
+// static |
+void SetUsePopupAsRootWindowForTest(bool use) { |
+ use_popup_as_root_window_for_test = use; |
+} |
+ |
+} // namespace test |
+ |
} // namespace ui |