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

Unified Diff: views/widget/drop_target_win.cc

Issue 8562003: Revert "views: Move widget/ directory to ui/views." properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « views/widget/drop_target_win.h ('k') | views/widget/gtk_views_fixed.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/drop_target_win.cc
diff --git a/views/widget/drop_target_win.cc b/views/widget/drop_target_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c4c8e2ceaac4ceae9d1ea9bfbeb409810af60b46
--- /dev/null
+++ b/views/widget/drop_target_win.cc
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 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 "views/widget/drop_target_win.h"
+
+#include "ui/base/dragdrop/drag_drop_types.h"
+#include "ui/base/dragdrop/os_exchange_data.h"
+#include "ui/base/dragdrop/os_exchange_data_provider_win.h"
+#include "ui/gfx/point.h"
+#include "views/widget/root_view.h"
+#include "views/widget/widget.h"
+
+using ui::OSExchangeData;
+using ui::OSExchangeDataProviderWin;
+
+namespace views {
+
+DropTargetWin::DropTargetWin(internal::RootView* root_view)
+ : ui::DropTarget(root_view->GetWidget()->GetNativeView()),
+ helper_(root_view) {
+}
+
+DropTargetWin::~DropTargetWin() {
+}
+
+void DropTargetWin::ResetTargetViewIfEquals(View* view) {
+ helper_.ResetTargetViewIfEquals(view);
+}
+
+DWORD DropTargetWin::OnDragOver(IDataObject* data_object,
+ DWORD key_state,
+ POINT cursor_position,
+ DWORD effect) {
+ gfx::Point root_view_location(cursor_position.x, cursor_position.y);
+ View::ConvertPointToView(NULL, helper_.root_view(), &root_view_location);
+ OSExchangeData data(new OSExchangeDataProviderWin(data_object));
+ int drop_operation =
+ helper_.OnDragOver(data, root_view_location,
+ ui::DragDropTypes::DropEffectToDragOperation(effect));
+ return ui::DragDropTypes::DragOperationToDropEffect(drop_operation);
+}
+
+void DropTargetWin::OnDragLeave(IDataObject* data_object) {
+ helper_.OnDragExit();
+}
+
+DWORD DropTargetWin::OnDrop(IDataObject* data_object,
+ DWORD key_state,
+ POINT cursor_position,
+ DWORD effect) {
+ gfx::Point root_view_location(cursor_position.x, cursor_position.y);
+ View::ConvertPointToView(NULL, helper_.root_view(), &root_view_location);
+
+ OSExchangeData data(new OSExchangeDataProviderWin(data_object));
+ int drop_operation = ui::DragDropTypes::DropEffectToDragOperation(effect);
+ drop_operation = helper_.OnDragOver(data, root_view_location,
+ drop_operation);
+ drop_operation = helper_.OnDrop(data, root_view_location, drop_operation);
+ return ui::DragDropTypes::DragOperationToDropEffect(drop_operation);
+}
+
+} // namespace views
« no previous file with comments | « views/widget/drop_target_win.h ('k') | views/widget/gtk_views_fixed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698