OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/drop_data_builder.h" | 5 #include "content/renderer/drop_data_builder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "content/public/common/drop_data.h" | 10 #include "content/public/common/drop_data.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 for (size_t i = 0; i < item_list.size(); ++i) { | 30 for (size_t i = 0; i < item_list.size(); ++i) { |
31 const WebDragData::Item& item = item_list[i]; | 31 const WebDragData::Item& item = item_list[i]; |
32 switch (item.storageType) { | 32 switch (item.storageType) { |
33 case WebDragData::Item::StorageTypeString: { | 33 case WebDragData::Item::StorageTypeString: { |
34 base::string16 str_type(item.stringType); | 34 base::string16 str_type(item.stringType); |
35 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeText)) { | 35 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeText)) { |
36 result.text = base::NullableString16(item.stringData, false); | 36 result.text = base::NullableString16(item.stringData, false); |
37 break; | 37 break; |
38 } | 38 } |
39 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeURIList)) { | 39 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeURIList)) { |
| 40 result.has_url = true; |
40 result.url = blink::WebStringToGURL(item.stringData); | 41 result.url = blink::WebStringToGURL(item.stringData); |
41 result.url_title = item.title; | 42 result.url_title = item.title; |
42 break; | 43 break; |
43 } | 44 } |
44 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeDownloadURL)) { | 45 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeDownloadURL)) { |
45 result.download_metadata = item.stringData; | 46 result.download_metadata = item.stringData; |
46 break; | 47 break; |
47 } | 48 } |
48 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeHTML)) { | 49 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeHTML)) { |
49 result.html = base::NullableString16(item.stringData, false); | 50 result.html = base::NullableString16(item.stringData, false); |
(...skipping 22 matching lines...) Expand all Loading... |
72 result.file_system_files.push_back(info); | 73 result.file_system_files.push_back(info); |
73 break; | 74 break; |
74 } | 75 } |
75 } | 76 } |
76 } | 77 } |
77 | 78 |
78 return result; | 79 return result; |
79 } | 80 } |
80 | 81 |
81 } // namespace content | 82 } // namespace content |
OLD | NEW |