| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 void OnDragLeave(IDataObject* data_object) { | 67 void OnDragLeave(IDataObject* data_object) { |
| 68 } | 68 } |
| 69 | 69 |
| 70 DWORD OnDrop(IDataObject* data_object, DWORD effect) { | 70 DWORD OnDrop(IDataObject* data_object, DWORD effect) { |
| 71 if (ui::ClipboardUtil::HasUrl(data_object)) { | 71 if (ui::ClipboardUtil::HasUrl(data_object)) { |
| 72 std::wstring url; | 72 std::wstring url; |
| 73 std::wstring title; | 73 std::wstring title; |
| 74 ui::ClipboardUtil::GetUrl(data_object, &url, &title, true); | 74 ui::ClipboardUtil::GetUrl(data_object, &url, &title, true); |
| 75 tab_contents_->OpenURL(GURL(url), GURL(), CURRENT_TAB, | 75 tab_contents_->OpenURL(GURL(url), GURL(), CURRENT_TAB, |
| 76 PageTransition::AUTO_BOOKMARK); | 76 content::PAGE_TRANSITION_AUTO_BOOKMARK); |
| 77 return GetPreferredDropEffect(effect); | 77 return GetPreferredDropEffect(effect); |
| 78 } | 78 } |
| 79 return DROPEFFECT_NONE; | 79 return DROPEFFECT_NONE; |
| 80 } | 80 } |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 TabContents* tab_contents_; | 83 TabContents* tab_contents_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(InterstitialDropTarget); | 85 DISALLOW_COPY_AND_ASSIGN(InterstitialDropTarget); |
| 86 }; | 86 }; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 Browser* browser = Browser::GetBrowserForController( | 231 Browser* browser = Browser::GetBrowserForController( |
| 232 &tab_contents_->controller(), NULL); | 232 &tab_contents_->controller(), NULL); |
| 233 if (browser) | 233 if (browser) |
| 234 browser->window()->Show(); | 234 browser->window()->Show(); |
| 235 | 235 |
| 236 // This isn't always correct, but at least it's a close approximation. | 236 // This isn't always correct, but at least it's a close approximation. |
| 237 // For now, we always map a move to a copy to prevent potential data loss. | 237 // For now, we always map a move to a copy to prevent potential data loss. |
| 238 DWORD drop_effect = web_drag_utils_win::WebDragOpToWinDragOp(drag_cursor_); | 238 DWORD drop_effect = web_drag_utils_win::WebDragOpToWinDragOp(drag_cursor_); |
| 239 return drop_effect != DROPEFFECT_MOVE ? drop_effect : DROPEFFECT_COPY; | 239 return drop_effect != DROPEFFECT_MOVE ? drop_effect : DROPEFFECT_COPY; |
| 240 } | 240 } |
| OLD | NEW |