OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/tab_contents/web_drop_target_win.h" | 5 #include "chrome/browser/tab_contents/web_drop_target_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return DROPEFFECT_NONE; | 75 return DROPEFFECT_NONE; |
76 } | 76 } |
77 | 77 |
78 private: | 78 private: |
79 TabContents* tab_contents_; | 79 TabContents* tab_contents_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(InterstitialDropTarget); | 81 DISALLOW_COPY_AND_ASSIGN(InterstitialDropTarget); |
82 }; | 82 }; |
83 | 83 |
84 WebDropTarget::WebDropTarget(HWND source_hwnd, TabContents* tab_contents) | 84 WebDropTarget::WebDropTarget(HWND source_hwnd, TabContents* tab_contents) |
85 : app::win::DropTarget(source_hwnd), | 85 : ui::DropTarget(source_hwnd), |
86 tab_contents_(tab_contents), | 86 tab_contents_(tab_contents), |
87 current_rvh_(NULL), | 87 current_rvh_(NULL), |
88 drag_cursor_(WebDragOperationNone), | 88 drag_cursor_(WebDragOperationNone), |
89 interstitial_drop_target_(new InterstitialDropTarget(tab_contents)) { | 89 interstitial_drop_target_(new InterstitialDropTarget(tab_contents)) { |
90 } | 90 } |
91 | 91 |
92 WebDropTarget::~WebDropTarget() { | 92 WebDropTarget::~WebDropTarget() { |
93 } | 93 } |
94 | 94 |
95 DWORD WebDropTarget::OnDragEnter(IDataObject* data_object, | 95 DWORD WebDropTarget::OnDragEnter(IDataObject* data_object, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 tab_contents_->GetBookmarkDragDelegate()->OnDrop(bookmark_drag_data); | 213 tab_contents_->GetBookmarkDragDelegate()->OnDrop(bookmark_drag_data); |
214 } | 214 } |
215 | 215 |
216 current_rvh_ = NULL; | 216 current_rvh_ = NULL; |
217 | 217 |
218 // This isn't always correct, but at least it's a close approximation. | 218 // This isn't always correct, but at least it's a close approximation. |
219 // For now, we always map a move to a copy to prevent potential data loss. | 219 // For now, we always map a move to a copy to prevent potential data loss. |
220 DWORD drop_effect = web_drag_utils_win::WebDragOpToWinDragOp(drag_cursor_); | 220 DWORD drop_effect = web_drag_utils_win::WebDragOpToWinDragOp(drag_cursor_); |
221 return drop_effect != DROPEFFECT_MOVE ? drop_effect : DROPEFFECT_COPY; | 221 return drop_effect != DROPEFFECT_MOVE ? drop_effect : DROPEFFECT_COPY; |
222 } | 222 } |
OLD | NEW |