| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/desktop_host_win.h" | 5 #include "ui/aura/desktop_host_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 SetWindowPos( | 199 SetWindowPos( |
| 200 hwnd(), | 200 hwnd(), |
| 201 NULL, | 201 NULL, |
| 202 0, | 202 0, |
| 203 0, | 203 0, |
| 204 window_rect.right - window_rect.left, | 204 window_rect.right - window_rect.left, |
| 205 window_rect.bottom - window_rect.top, | 205 window_rect.bottom - window_rect.top, |
| 206 SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION); | 206 SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION); |
| 207 } | 207 } |
| 208 | 208 |
| 209 gfx::Point DesktopHostWin::GetLocationOnNativeScreen() const { |
| 210 RECT r; |
| 211 GetClientRect(hwnd(), &r); |
| 212 return gfx::Point(r.left, r.top); |
| 213 } |
| 214 |
| 215 |
| 209 void DesktopHostWin::SetCursor(gfx::NativeCursor native_cursor) { | 216 void DesktopHostWin::SetCursor(gfx::NativeCursor native_cursor) { |
| 210 // Custom web cursors are handled directly. | 217 // Custom web cursors are handled directly. |
| 211 if (native_cursor == kCursorCustom) | 218 if (native_cursor == kCursorCustom) |
| 212 return; | 219 return; |
| 213 const wchar_t* cursor_id = GetCursorId(native_cursor); | 220 const wchar_t* cursor_id = GetCursorId(native_cursor); |
| 214 // TODO(jamescook): Support for non-system cursors will require finding | 221 // TODO(jamescook): Support for non-system cursors will require finding |
| 215 // the appropriate module to pass to LoadCursor(). | 222 // the appropriate module to pass to LoadCursor(). |
| 216 ::SetCursor(LoadCursor(NULL, cursor_id)); | 223 ::SetCursor(LoadCursor(NULL, cursor_id)); |
| 217 } | 224 } |
| 218 | 225 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 270 } |
| 264 | 271 |
| 265 void DesktopHostWin::OnSize(UINT param, const CSize& size) { | 272 void DesktopHostWin::OnSize(UINT param, const CSize& size) { |
| 266 // Minimizing resizes the window to 0x0 which causes our layout to go all | 273 // Minimizing resizes the window to 0x0 which causes our layout to go all |
| 267 // screwy, so we just ignore it. | 274 // screwy, so we just ignore it. |
| 268 if (param != SIZE_MINIMIZED) | 275 if (param != SIZE_MINIMIZED) |
| 269 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); | 276 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); |
| 270 } | 277 } |
| 271 | 278 |
| 272 } // namespace aura | 279 } // namespace aura |
| OLD | NEW |