| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "webkit/glue/webdropdata.h" | 5 #include "webkit/glue/webdropdata.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 | 10 |
| 11 #include "app/clipboard/clipboard_util_win.h" | 11 #include "app/clipboard/clipboard_util_win.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 void WebDropData::PopulateWebDropData(IDataObject* data_object, | 15 void WebDropData::PopulateWebDropData(IDataObject* data_object, |
| 16 WebDropData* drop_data) { | 16 WebDropData* drop_data) { |
| 17 std::wstring url_str; | 17 std::wstring url_str; |
| 18 if (ClipboardUtil::GetUrl(data_object, &url_str, &drop_data->url_title)) { | 18 if (ClipboardUtil::GetUrl(data_object, &url_str, &drop_data->url_title, |
| 19 false)) { |
| 19 GURL test_url(url_str); | 20 GURL test_url(url_str); |
| 20 if (test_url.is_valid()) | 21 if (test_url.is_valid()) |
| 21 drop_data->url = test_url; | 22 drop_data->url = test_url; |
| 22 } | 23 } |
| 23 ClipboardUtil::GetFilenames(data_object, &drop_data->filenames); | 24 ClipboardUtil::GetFilenames(data_object, &drop_data->filenames); |
| 24 ClipboardUtil::GetPlainText(data_object, &drop_data->plain_text); | 25 ClipboardUtil::GetPlainText(data_object, &drop_data->plain_text); |
| 25 std::string base_url; | 26 std::string base_url; |
| 26 ClipboardUtil::GetHtml(data_object, &drop_data->text_html, &base_url); | 27 ClipboardUtil::GetHtml(data_object, &drop_data->text_html, &base_url); |
| 27 if (!base_url.empty()) { | 28 if (!base_url.empty()) { |
| 28 drop_data->html_base_url = GURL(base_url); | 29 drop_data->html_base_url = GURL(base_url); |
| 29 } | 30 } |
| 30 ClipboardUtil::GetFileContents(data_object, | 31 ClipboardUtil::GetFileContents(data_object, |
| 31 &drop_data->file_description_filename, &drop_data->file_contents); | 32 &drop_data->file_description_filename, &drop_data->file_contents); |
| 32 } | 33 } |
| OLD | NEW |