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

Unified Diff: chrome/views/root_view_drop_target.cc

Issue 7317: Change all ConvertPointTo* methods to use gfx::Point instead of CPoint.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/views/root_view_drop_target.h ('k') | chrome/views/tooltip_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/root_view_drop_target.cc
===================================================================
--- chrome/views/root_view_drop_target.cc (revision 3347)
+++ chrome/views/root_view_drop_target.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/views/root_view_drop_target.h"
+#include "base/gfx/point.h"
#include "base/logging.h"
#include "chrome/common/drag_drop_types.h"
#include "chrome/views/root_view.h"
@@ -33,7 +34,7 @@
POINT cursor_position,
DWORD effect) {
const OSExchangeData data(data_object);
- CPoint root_view_location(cursor_position.x, cursor_position.y);
+ gfx::Point root_view_location(cursor_position.x, cursor_position.y);
View::ConvertPointToView(NULL, root_view_, &root_view_location);
View* view = CalculateTargetView(root_view_location, data);
@@ -43,22 +44,22 @@
target_view_->OnDragExited();
target_view_ = view;
if (target_view_) {
- CPoint target_view_location(root_view_location.x, root_view_location.y);
+ gfx::Point target_view_location(root_view_location);
View::ConvertPointToView(root_view_, target_view_, &target_view_location);
DropTargetEvent enter_event(data,
- target_view_location.x,
- target_view_location.y,
+ target_view_location.x(),
+ target_view_location.y(),
DragDropTypes::DropEffectToDragOperation(effect));
target_view_->OnDragEntered(enter_event);
}
}
if (target_view_) {
- CPoint target_view_location(root_view_location.x, root_view_location.y);
+ gfx::Point target_view_location(root_view_location);
View::ConvertPointToView(root_view_, target_view_, &target_view_location);
DropTargetEvent enter_event(data,
- target_view_location.x,
- target_view_location.y,
+ target_view_location.x(),
+ target_view_location.y(),
DragDropTypes::DropEffectToDragOperation(effect));
int result_operation = target_view_->OnDragUpdated(enter_event);
return DragDropTypes::DragOperationToDropEffect(result_operation);
@@ -83,9 +84,9 @@
View* drop_view = target_view_;
deepest_view_ = target_view_ = NULL;
if (drop_effect != DROPEFFECT_NONE) {
- CPoint view_location(cursor_position.x, cursor_position.y);
+ gfx::Point view_location(cursor_position.x, cursor_position.y);
View::ConvertPointToView(NULL, drop_view, &view_location);
- DropTargetEvent drop_event(data, view_location.x, view_location.y,
+ DropTargetEvent drop_event(data, view_location.x(), view_location.y(),
DragDropTypes::DropEffectToDragOperation(effect));
return DragDropTypes::DragOperationToDropEffect(
drop_view->OnPerformDrop(drop_event));
@@ -97,9 +98,9 @@
}
View* RootViewDropTarget::CalculateTargetView(
- const CPoint& root_view_location,
+ const gfx::Point& root_view_location,
const OSExchangeData& data) {
- View* view = root_view_->GetViewForPoint(root_view_location);
+ View* view = root_view_->GetViewForPoint(root_view_location.ToPOINT());
if (view == deepest_view_) {
// The view the mouse is over hasn't changed; reuse the target.
return target_view_;
« no previous file with comments | « chrome/views/root_view_drop_target.h ('k') | chrome/views/tooltip_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698