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 "content/browser/web_contents/web_drag_dest_win.h" | 5 #include "content/browser/web_contents/web_drag_dest_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 drop_data->url = test_url; | 71 drop_data->url = test_url; |
72 } | 72 } |
73 std::vector<base::string16> filenames; | 73 std::vector<base::string16> filenames; |
74 ui::ClipboardUtil::GetFilenames(data_object, &filenames); | 74 ui::ClipboardUtil::GetFilenames(data_object, &filenames); |
75 for (size_t i = 0; i < filenames.size(); ++i) | 75 for (size_t i = 0; i < filenames.size(); ++i) |
76 drop_data->filenames.push_back( | 76 drop_data->filenames.push_back( |
77 WebDropData::FileInfo(filenames[i], base::string16())); | 77 WebDropData::FileInfo(filenames[i], base::string16())); |
78 base::string16 text; | 78 base::string16 text; |
79 ui::ClipboardUtil::GetPlainText(data_object, &text); | 79 ui::ClipboardUtil::GetPlainText(data_object, &text); |
80 if (!text.empty()) { | 80 if (!text.empty()) { |
81 drop_data->text = NullableString16(text, false); | 81 drop_data->text = base::NullableString16(text, false); |
82 } | 82 } |
83 base::string16 html; | 83 base::string16 html; |
84 std::string html_base_url; | 84 std::string html_base_url; |
85 ui::ClipboardUtil::GetHtml(data_object, &html, &html_base_url); | 85 ui::ClipboardUtil::GetHtml(data_object, &html, &html_base_url); |
86 if (!html.empty()) { | 86 if (!html.empty()) { |
87 drop_data->html = NullableString16(html, false); | 87 drop_data->html = base::NullableString16(html, false); |
88 } | 88 } |
89 if (!html_base_url.empty()) { | 89 if (!html_base_url.empty()) { |
90 drop_data->html_base_url = GURL(html_base_url); | 90 drop_data->html_base_url = GURL(html_base_url); |
91 } | 91 } |
92 ui::ClipboardUtil::GetWebCustomData(data_object, &drop_data->custom_data); | 92 ui::ClipboardUtil::GetWebCustomData(data_object, &drop_data->custom_data); |
93 } | 93 } |
94 | 94 |
95 } // namespace | 95 } // namespace |
96 | 96 |
97 // InterstitialDropTarget is like a ui::DropTargetWin implementation that | 97 // InterstitialDropTarget is like a ui::DropTargetWin implementation that |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // This isn't always correct, but at least it's a close approximation. | 277 // This isn't always correct, but at least it's a close approximation. |
278 // For now, we always map a move to a copy to prevent potential data loss. | 278 // For now, we always map a move to a copy to prevent potential data loss. |
279 DWORD drop_effect = WebDragOpToWinDragOp(drag_cursor_); | 279 DWORD drop_effect = WebDragOpToWinDragOp(drag_cursor_); |
280 DWORD result = drop_effect != DROPEFFECT_MOVE ? drop_effect : DROPEFFECT_COPY; | 280 DWORD result = drop_effect != DROPEFFECT_MOVE ? drop_effect : DROPEFFECT_COPY; |
281 | 281 |
282 drop_data_.reset(); | 282 drop_data_.reset(); |
283 return result; | 283 return result; |
284 } | 284 } |
285 | 285 |
286 } // namespace content | 286 } // namespace content |
OLD | NEW |