Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: webkit/glue/webdropdata_win.cc

Issue 2126010: Don't populate WebDropData with file URLs when dragging files. (Closed)
Patch Set: . Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/tab_contents/web_drop_target_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/web_drop_target_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698