| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 void RootWindowHostWin::ReleaseCapture() { | 168 void RootWindowHostWin::ReleaseCapture() { |
| 169 if (has_capture_) { | 169 if (has_capture_) { |
| 170 has_capture_ = false; | 170 has_capture_ = false; |
| 171 ::ReleaseCapture(); | 171 ::ReleaseCapture(); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 void RootWindowHostWin::ShowCursor(bool show) { | |
| 176 // NOTIMPLEMENTED(); | |
| 177 } | |
| 178 | |
| 179 bool RootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { | 175 bool RootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { |
| 180 POINT pt; | 176 POINT pt; |
| 181 GetCursorPos(&pt); | 177 GetCursorPos(&pt); |
| 182 ScreenToClient(hwnd(), &pt); | 178 ScreenToClient(hwnd(), &pt); |
| 183 const gfx::Size size = GetBounds().size(); | 179 const gfx::Size size = GetBounds().size(); |
| 184 *location_return = | 180 *location_return = |
| 185 gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))), | 181 gfx::Point(max(0, min(size.width(), static_cast<int>(pt.x))), |
| 186 max(0, min(size.height(), static_cast<int>(pt.y)))); | 182 max(0, min(size.height(), static_cast<int>(pt.y)))); |
| 187 return (pt.x >= 0 && static_cast<int>(pt.x) < size.width() && | 183 return (pt.x >= 0 && static_cast<int>(pt.x) < size.width() && |
| 188 pt.y >= 0 && static_cast<int>(pt.y) < size.height()); | 184 pt.y >= 0 && static_cast<int>(pt.y) < size.height()); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 268 } |
| 273 | 269 |
| 274 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { | 270 void RootWindowHostWin::OnSize(UINT param, const CSize& size) { |
| 275 // Minimizing resizes the window to 0x0 which causes our layout to go all | 271 // Minimizing resizes the window to 0x0 which causes our layout to go all |
| 276 // screwy, so we just ignore it. | 272 // screwy, so we just ignore it. |
| 277 if (param != SIZE_MINIMIZED) | 273 if (param != SIZE_MINIMIZED) |
| 278 delegate_->OnHostResized(gfx::Size(size.cx, size.cy)); | 274 delegate_->OnHostResized(gfx::Size(size.cx, size.cy)); |
| 279 } | 275 } |
| 280 | 276 |
| 281 } // namespace aura | 277 } // namespace aura |
| OLD | NEW |