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

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: gfx image include 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
« no previous file with comments | « content/common/cursors/webcursor.h ('k') | content/common/cursors/webcursor_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 namespace content {
16
15 WebCursor::WebCursor() 17 WebCursor::WebCursor()
16 : type_(WebCursorInfo::TypePointer), 18 : type_(WebCursorInfo::TypePointer),
17 custom_scale_(1) { 19 custom_scale_(1) {
18 #if defined(OS_WIN) 20 #if defined(OS_WIN)
19 external_cursor_ = NULL; 21 external_cursor_ = NULL;
20 #endif 22 #endif
21 InitPlatformData(); 23 InitPlatformData();
22 } 24 }
23 25
24 WebCursor::WebCursor(const CursorInfo& cursor_info) 26 WebCursor::WebCursor(const CursorInfo& cursor_info)
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 void WebCursor::ClampHotspot() { 254 void WebCursor::ClampHotspot() {
253 if (!IsCustom()) 255 if (!IsCustom())
254 return; 256 return;
255 257
256 // Clamp the hotspot to the custom image's dimensions. 258 // Clamp the hotspot to the custom image's dimensions.
257 hotspot_.set_x(std::max(0, 259 hotspot_.set_x(std::max(0,
258 std::min(custom_size_.width() - 1, hotspot_.x()))); 260 std::min(custom_size_.width() - 1, hotspot_.x())));
259 hotspot_.set_y(std::max(0, 261 hotspot_.set_y(std::max(0,
260 std::min(custom_size_.height() - 1, hotspot_.y()))); 262 std::min(custom_size_.height() - 1, hotspot_.y())));
261 } 263 }
264
265 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cursors/webcursor.h ('k') | content/common/cursors/webcursor_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698