Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/base/dragdrop/drag_drop_types.h" | 8 #include "ui/base/dragdrop/drag_drop_types.h" |
| 9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 if (!drop_view) | 56 if (!drop_view) |
| 57 return ui::DragDropTypes::DRAG_NONE; | 57 return ui::DragDropTypes::DRAG_NONE; |
| 58 | 58 |
| 59 if (drag_operation == ui::DragDropTypes::DRAG_NONE) { | 59 if (drag_operation == ui::DragDropTypes::DRAG_NONE) { |
| 60 drop_view->OnDragExited(); | 60 drop_view->OnDragExited(); |
| 61 return ui::DragDropTypes::DRAG_NONE; | 61 return ui::DragDropTypes::DRAG_NONE; |
| 62 } | 62 } |
| 63 | 63 |
| 64 gfx::Point view_location(root_view_location); | 64 gfx::Point view_location(root_view_location); |
| 65 View* root_view = drop_view->GetWidget()->GetRootView(); | 65 View* root_view = drop_view->GetWidget()->GetRootView(); |
| 66 root_view = root_view_; | |
|
tapted
2016/05/24 08:06:02
Ah, BridgedNativeWidgetTestBase does some weird st
spqchan
2016/05/26 01:56:55
Done.
| |
| 67 | |
| 66 View::ConvertPointToTarget(root_view, drop_view, &view_location); | 68 View::ConvertPointToTarget(root_view, drop_view, &view_location); |
| 67 ui::DropTargetEvent drop_event(data, view_location, view_location, | 69 ui::DropTargetEvent drop_event(data, view_location, view_location, |
| 68 drag_operation); | 70 drag_operation); |
| 69 return drop_view->OnPerformDrop(drop_event); | 71 return drop_view->OnPerformDrop(drop_event); |
| 70 } | 72 } |
| 71 | 73 |
| 72 View* DropHelper::CalculateTargetView( | 74 View* DropHelper::CalculateTargetView( |
| 73 const gfx::Point& root_view_location, | 75 const gfx::Point& root_view_location, |
| 74 const OSExchangeData& data, | 76 const OSExchangeData& data, |
| 75 bool check_can_drop) { | 77 bool check_can_drop) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 drag_operation); | 150 drag_operation); |
| 149 return target_view_->OnDragUpdated(enter_event); | 151 return target_view_->OnDragUpdated(enter_event); |
| 150 } | 152 } |
| 151 | 153 |
| 152 void DropHelper::NotifyDragExit() { | 154 void DropHelper::NotifyDragExit() { |
| 153 if (target_view_) | 155 if (target_view_) |
| 154 target_view_->OnDragExited(); | 156 target_view_->OnDragExited(); |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace views | 159 } // namespace views |
| OLD | NEW |