| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <shlobj.h> | 6 #include <shlobj.h> |
| 7 | 7 |
| 8 #include "chrome/browser/web_drop_target.h" | 8 #include "chrome/browser/web_drop_target.h" |
| 9 | 9 |
| 10 #include "base/clipboard_util.h" | 10 #include "base/clipboard_util.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 void OnDragLeave(IDataObject* data_object) { | 53 void OnDragLeave(IDataObject* data_object) { |
| 54 } | 54 } |
| 55 | 55 |
| 56 DWORD OnDrop(IDataObject* data_object, DWORD effect) { | 56 DWORD OnDrop(IDataObject* data_object, DWORD effect) { |
| 57 if (ClipboardUtil::HasUrl(data_object)) { | 57 if (ClipboardUtil::HasUrl(data_object)) { |
| 58 std::wstring url; | 58 std::wstring url; |
| 59 std::wstring title; | 59 std::wstring title; |
| 60 ClipboardUtil::GetUrl(data_object, &url, &title); | 60 ClipboardUtil::GetUrl(data_object, &url, &title); |
| 61 web_contents_->OpenURL(GURL(url), CURRENT_TAB, | 61 web_contents_->OpenURL(GURL(url), GURL(), CURRENT_TAB, |
| 62 PageTransition::AUTO_BOOKMARK); | 62 PageTransition::AUTO_BOOKMARK); |
| 63 return GetPreferredDropEffect(effect); | 63 return GetPreferredDropEffect(effect); |
| 64 } | 64 } |
| 65 return DROPEFFECT_NONE; | 65 return DROPEFFECT_NONE; |
| 66 } | 66 } |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 WebContents* web_contents_; | 69 WebContents* web_contents_; |
| 70 | 70 |
| 71 DISALLOW_EVIL_CONSTRUCTORS(InterstitialDropTarget); | 71 DISALLOW_EVIL_CONSTRUCTORS(InterstitialDropTarget); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 ScreenToClient(GetHWND(), &client_pt); | 154 ScreenToClient(GetHWND(), &client_pt); |
| 155 web_contents_->render_view_host()->DragTargetDrop( | 155 web_contents_->render_view_host()->DragTargetDrop( |
| 156 gfx::Point(client_pt.x, client_pt.y), | 156 gfx::Point(client_pt.x, client_pt.y), |
| 157 gfx::Point(cursor_position.x, cursor_position.y)); | 157 gfx::Point(cursor_position.x, cursor_position.y)); |
| 158 | 158 |
| 159 // We lie and always claim that the drop operation didn't happen because we | 159 // We lie and always claim that the drop operation didn't happen because we |
| 160 // don't want to wait for the renderer to respond. | 160 // don't want to wait for the renderer to respond. |
| 161 return DROPEFFECT_NONE; | 161 return DROPEFFECT_NONE; |
| 162 } | 162 } |
| 163 | 163 |
| OLD | NEW |