summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/drag_delegate.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-03 19:22:37 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-03 19:22:37 +0000
commit07d2b14b7978a9f32cfa98ec01cb7d79f8c737ec (patch)
treed9038759883e5b895cb01b39c4e34fdd2b09a8ad /webkit/tools/test_shell/drag_delegate.cc
parent5f059ab3f96e21c6d1061efcc3718ff1037b9eb9 (diff)
downloadchromium_src-07d2b14b7978a9f32cfa98ec01cb7d79f8c737ec.zip
chromium_src-07d2b14b7978a9f32cfa98ec01cb7d79f8c737ec.tar.gz
chromium_src-07d2b14b7978a9f32cfa98ec01cb7d79f8c737ec.tar.bz2
Convert usage of CPoint to gfx::Point.
BUG=5022 TEST=none Review URL: http://codereview.chromium.org/160514 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22298 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/drag_delegate.cc')
-rw-r--r--webkit/tools/test_shell/drag_delegate.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/webkit/tools/test_shell/drag_delegate.cc b/webkit/tools/test_shell/drag_delegate.cc
index f3532ad..5f447ef 100644
--- a/webkit/tools/test_shell/drag_delegate.cc
+++ b/webkit/tools/test_shell/drag_delegate.cc
@@ -1,11 +1,9 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "webkit/tools/test_shell/drag_delegate.h"
-#include <atltypes.h>
-
#include "webkit/api/public/WebPoint.h"
#include "webkit/glue/webview.h"
@@ -13,14 +11,18 @@ using WebKit::WebPoint;
namespace {
-void GetCursorPositions(HWND hwnd, CPoint* client, CPoint* screen) {
+void GetCursorPositions(HWND hwnd, gfx::Point* client, gfx::Point* screen) {
// GetCursorPos will fail if the input desktop isn't the current desktop.
// See http://b/1173534. (0,0) is wrong, but better than uninitialized.
- if (!GetCursorPos(screen))
- screen->SetPoint(0, 0);
-
- *client = *screen;
- ScreenToClient(hwnd, client);
+ POINT pos;
+ if (!GetCursorPos(&pos)) {
+ pos.x = 0;
+ pos.y = 0;
+ }
+
+ *screen = gfx::Point(pos);
+ ScreenToClient(hwnd, &pos);
+ *client = gfx::Point(pos);
}
} // anonymous namespace
@@ -30,17 +32,15 @@ void TestDragDelegate::OnDragSourceCancel() {
}
void TestDragDelegate::OnDragSourceDrop() {
- CPoint client;
- CPoint screen;
+ gfx::Point client;
+ gfx::Point screen;
GetCursorPositions(source_hwnd_, &client, &screen);
- webview_->DragSourceEndedAt(WebPoint(client.x, client.y),
- WebPoint(screen.x, screen.y));
+ webview_->DragSourceEndedAt(client, screen);
}
void TestDragDelegate::OnDragSourceMove() {
- CPoint client;
- CPoint screen;
+ gfx::Point client;
+ gfx::Point screen;
GetCursorPositions(source_hwnd_, &client, &screen);
- webview_->DragSourceMovedTo(WebPoint(client.x, client.y),
- WebPoint(screen.x, screen.y));
+ webview_->DragSourceMovedTo(client, screen);
}