| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window_host_win.h" | 5 #include "ui/aura/root_window_host_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 return gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))), | 260 return gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))), |
| 261 max(0, min(size.height(), static_cast<int>(pt.y)))); | 261 max(0, min(size.height(), static_cast<int>(pt.y)))); |
| 262 } | 262 } |
| 263 | 263 |
| 264 bool RootWindowHostWin::ConfineCursorToRootWindow() { | 264 bool RootWindowHostWin::ConfineCursorToRootWindow() { |
| 265 RECT window_rect; | 265 RECT window_rect; |
| 266 GetWindowRect(hwnd(), &window_rect); | 266 GetWindowRect(hwnd(), &window_rect); |
| 267 return ClipCursor(&window_rect) != 0; | 267 return ClipCursor(&window_rect) != 0; |
| 268 } | 268 } |
| 269 | 269 |
| 270 bool RootWindowHostWin::GrabSnapshot( |
| 271 std::vector<unsigned char>* png_representation, |
| 272 const gfx::Rect& snapshot_bounds) { |
| 273 NOTIMPLEMENTED(); |
| 274 return false; |
| 275 } |
| 276 |
| 270 void RootWindowHostWin::UnConfineCursor() { | 277 void RootWindowHostWin::UnConfineCursor() { |
| 271 ClipCursor(NULL); | 278 ClipCursor(NULL); |
| 272 } | 279 } |
| 273 | 280 |
| 274 void RootWindowHostWin::MoveCursorTo(const gfx::Point& location) { | 281 void RootWindowHostWin::MoveCursorTo(const gfx::Point& location) { |
| 275 POINT pt; | 282 POINT pt; |
| 276 ClientToScreen(hwnd(), &pt); | 283 ClientToScreen(hwnd(), &pt); |
| 277 SetCursorPos(pt.x, pt.y); | 284 SetCursorPos(pt.x, pt.y); |
| 278 } | 285 } |
| 279 | 286 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 336 } |
| 330 | 337 |
| 331 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { | 338 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { |
| 332 // Minimizing resizes the window to 0x0 which causes our layout to go all | 339 // Minimizing resizes the window to 0x0 which causes our layout to go all |
| 333 // screwy, so we just ignore it. | 340 // screwy, so we just ignore it. |
| 334 if (param != SIZE_MINIMIZED) | 341 if (param != SIZE_MINIMIZED) |
| 335 root_window_->OnHostResized(gfx::Size(size.cx, size.cy)); | 342 root_window_->OnHostResized(gfx::Size(size.cx, size.cy)); |
| 336 } | 343 } |
| 337 | 344 |
| 338 } // namespace aura | 345 } // namespace aura |
| OLD | NEW |