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 "webkit/glue/webcursor.h" | 5 #include "webkit/glue/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/WebKit/chromium/public/WebCursorInfo.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" |
11 | 11 |
12 using WebKit::WebCursorInfo; | 12 using WebKit::WebCursorInfo; |
13 using WebKit::WebImage; | 13 using WebKit::WebImage; |
14 | 14 |
15 static const int kMaxCursorDimension = 1024; | 15 static const int kMaxCursorDimension = 1024; |
16 | 16 |
17 WebCursor::WebCursor() | 17 WebCursor::WebCursor() |
18 : type_(WebCursorInfo::TypePointer) { | 18 : type_(WebCursorInfo::TypePointer) { |
19 InitPlatformData(); | 19 InitPlatformData(); |
20 } | 20 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void WebCursor::ClampHotspot() { | 200 void WebCursor::ClampHotspot() { |
201 if (!IsCustom()) | 201 if (!IsCustom()) |
202 return; | 202 return; |
203 | 203 |
204 // Clamp the hotspot to the custom image's dimensions. | 204 // Clamp the hotspot to the custom image's dimensions. |
205 hotspot_.set_x(std::max(0, | 205 hotspot_.set_x(std::max(0, |
206 std::min(custom_size_.width() - 1, hotspot_.x()))); | 206 std::min(custom_size_.width() - 1, hotspot_.x()))); |
207 hotspot_.set_y(std::max(0, | 207 hotspot_.set_y(std::max(0, |
208 std::min(custom_size_.height() - 1, hotspot_.y()))); | 208 std::min(custom_size_.height() - 1, hotspot_.y()))); |
209 } | 209 } |
OLD | NEW |