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

Side by Side Diff: ui/views/widget/drop_helper.cc

Issue 10824295: Rid the world of the last of views::Event types: TouchEvent, GestureEvent, MouseWheelEvent, ScrollE… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « ui/views/views.gyp ('k') | ui/views/widget/native_widget_aura.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 "ui/views/widget/drop_helper.h" 5 #include "ui/views/widget/drop_helper.h"
6 6
7 #include "ui/base/dragdrop/drag_drop_types.h" 7 #include "ui/base/dragdrop/drag_drop_types.h"
8 #include "ui/views/view.h" 8 #include "ui/views/view.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return ui::DragDropTypes::DRAG_NONE; 56 return ui::DragDropTypes::DRAG_NONE;
57 57
58 if (drag_operation == ui::DragDropTypes::DRAG_NONE) { 58 if (drag_operation == ui::DragDropTypes::DRAG_NONE) {
59 drop_view->OnDragExited(); 59 drop_view->OnDragExited();
60 return ui::DragDropTypes::DRAG_NONE; 60 return ui::DragDropTypes::DRAG_NONE;
61 } 61 }
62 62
63 gfx::Point view_location(root_view_location); 63 gfx::Point view_location(root_view_location);
64 View* root_view = drop_view->GetWidget()->GetRootView(); 64 View* root_view = drop_view->GetWidget()->GetRootView();
65 View::ConvertPointToTarget(root_view, drop_view, &view_location); 65 View::ConvertPointToTarget(root_view, drop_view, &view_location);
66 DropTargetEvent drop_event(data, view_location.x(), view_location.y(), 66 ui::DropTargetEvent drop_event(data, view_location, view_location,
67 drag_operation); 67 drag_operation);
68 return drop_view->OnPerformDrop(drop_event); 68 return drop_view->OnPerformDrop(drop_event);
69 } 69 }
70 70
71 View* DropHelper::CalculateTargetView( 71 View* DropHelper::CalculateTargetView(
72 const gfx::Point& root_view_location, 72 const gfx::Point& root_view_location,
73 const OSExchangeData& data, 73 const OSExchangeData& data,
74 bool check_can_drop) { 74 bool check_can_drop) {
75 return CalculateTargetViewImpl(root_view_location, data, check_can_drop, 75 return CalculateTargetViewImpl(root_view_location, data, check_can_drop,
76 NULL); 76 NULL);
77 } 77 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 void DropHelper::NotifyDragEntered(const OSExchangeData& data, 121 void DropHelper::NotifyDragEntered(const OSExchangeData& data,
122 const gfx::Point& root_view_location, 122 const gfx::Point& root_view_location,
123 int drag_operation) { 123 int drag_operation) {
124 if (!target_view_) 124 if (!target_view_)
125 return; 125 return;
126 126
127 gfx::Point target_view_location(root_view_location); 127 gfx::Point target_view_location(root_view_location);
128 View::ConvertPointToTarget(root_view_, target_view_, &target_view_location); 128 View::ConvertPointToTarget(root_view_, target_view_, &target_view_location);
129 DropTargetEvent enter_event(data, 129 ui::DropTargetEvent enter_event(data,
130 target_view_location.x(), 130 target_view_location,
131 target_view_location.y(), 131 target_view_location,
132 drag_operation); 132 drag_operation);
133 target_view_->OnDragEntered(enter_event); 133 target_view_->OnDragEntered(enter_event);
134 } 134 }
135 135
136 int DropHelper::NotifyDragOver(const OSExchangeData& data, 136 int DropHelper::NotifyDragOver(const OSExchangeData& data,
137 const gfx::Point& root_view_location, 137 const gfx::Point& root_view_location,
138 int drag_operation) { 138 int drag_operation) {
139 if (!target_view_) 139 if (!target_view_)
140 return ui::DragDropTypes::DRAG_NONE; 140 return ui::DragDropTypes::DRAG_NONE;
141 141
142 gfx::Point target_view_location(root_view_location); 142 gfx::Point target_view_location(root_view_location);
143 View::ConvertPointToTarget(root_view_, target_view_, &target_view_location); 143 View::ConvertPointToTarget(root_view_, target_view_, &target_view_location);
144 DropTargetEvent enter_event(data, 144 ui::DropTargetEvent enter_event(data,
145 target_view_location.x(), 145 target_view_location,
146 target_view_location.y(), 146 target_view_location,
147 drag_operation); 147 drag_operation);
148 return target_view_->OnDragUpdated(enter_event); 148 return target_view_->OnDragUpdated(enter_event);
149 } 149 }
150 150
151 void DropHelper::NotifyDragExit() { 151 void DropHelper::NotifyDragExit() {
152 if (target_view_) 152 if (target_view_)
153 target_view_->OnDragExited(); 153 target_view_->OnDragExited();
154 } 154 }
155 155
156 } // namespace views 156 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698