Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Side by Side Diff: content/common/cursors/webcursor.cc

Issue 201473002: Move webcursors code from webkit/ to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/common/cursors/webcursor.h" 5 #include "content/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/public/platform/WebImage.h" 9 #include "third_party/WebKit/public/platform/WebImage.h"
10 10
11 using blink::WebCursorInfo; 11 using blink::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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698