| 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 "webkit/glue/webcursor.h" | 5 #include "webkit/common/cursors/webcursor.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" |
| 10 | 10 |
| 11 using WebKit::WebCursorInfo; | 11 using WebKit::WebCursorInfo; |
| 12 | 12 |
| 13 static const int kMaxCursorDimension = 1024; | 13 static const int kMaxCursorDimension = 1024; |
| 14 | 14 |
| 15 WebCursor::WebCursor() | 15 WebCursor::WebCursor() |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 void WebCursor::ClampHotspot() { | 252 void WebCursor::ClampHotspot() { |
| 253 if (!IsCustom()) | 253 if (!IsCustom()) |
| 254 return; | 254 return; |
| 255 | 255 |
| 256 // Clamp the hotspot to the custom image's dimensions. | 256 // Clamp the hotspot to the custom image's dimensions. |
| 257 hotspot_.set_x(std::max(0, | 257 hotspot_.set_x(std::max(0, |
| 258 std::min(custom_size_.width() - 1, hotspot_.x()))); | 258 std::min(custom_size_.width() - 1, hotspot_.x()))); |
| 259 hotspot_.set_y(std::max(0, | 259 hotspot_.set_y(std::max(0, |
| 260 std::min(custom_size_.height() - 1, hotspot_.y()))); | 260 std::min(custom_size_.height() - 1, hotspot_.y()))); |
| 261 } | 261 } |
| OLD | NEW |