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

Unified Diff: ui/platform_window/win/win_window.cc

Issue 400413002: aura: Use PlatformWindow from WindowTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months 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
« ui/aura/aura.gyp ('K') | « ui/platform_window/win/win_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« ui/aura/aura.gyp ('K') | « ui/platform_window/win/win_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698