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 "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "content/public/common/drop_data.h" | 8 #include "content/public/common/drop_data.h" |
9 #include "third_party/WebKit/public/platform/WebDragData.h" | 9 #include "third_party/WebKit/public/platform/WebDragData.h" |
10 #include "third_party/WebKit/public/platform/WebString.h" | 10 #include "third_party/WebKit/public/platform/WebString.h" |
11 #include "third_party/WebKit/public/platform/WebVector.h" | 11 #include "third_party/WebKit/public/platform/WebVector.h" |
12 #include "ui/base/clipboard/clipboard.h" | 12 #include "ui/base/clipboard/clipboard.h" |
13 | 13 |
14 using blink::WebDragData; | 14 using blink::WebDragData; |
15 using blink::WebVector; | 15 using blink::WebVector; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 // static | 19 // static |
20 DropData DropDataBuilder::Build(const WebDragData& drag_data) { | 20 DropData DropDataBuilder::Build(const WebDragData& drag_data) { |
21 DropData result; | 21 DropData result; |
| 22 result.key_modifiers = drag_data.modifierKeyState(); |
22 result.referrer_policy = blink::WebReferrerPolicyDefault; | 23 result.referrer_policy = blink::WebReferrerPolicyDefault; |
23 | 24 |
24 const WebVector<WebDragData::Item>& item_list = drag_data.items(); | 25 const WebVector<WebDragData::Item>& item_list = drag_data.items(); |
25 for (size_t i = 0; i < item_list.size(); ++i) { | 26 for (size_t i = 0; i < item_list.size(); ++i) { |
26 const WebDragData::Item& item = item_list[i]; | 27 const WebDragData::Item& item = item_list[i]; |
27 switch (item.storageType) { | 28 switch (item.storageType) { |
28 case WebDragData::Item::StorageTypeString: { | 29 case WebDragData::Item::StorageTypeString: { |
29 base::string16 str_type(item.stringType); | 30 base::string16 str_type(item.stringType); |
30 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeText)) { | 31 if (base::EqualsASCII(str_type, ui::Clipboard::kMimeTypeText)) { |
31 result.text = base::NullableString16(item.stringData, false); | 32 result.text = base::NullableString16(item.stringData, false); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 result.file_system_files.push_back(info); | 68 result.file_system_files.push_back(info); |
68 break; | 69 break; |
69 } | 70 } |
70 } | 71 } |
71 } | 72 } |
72 | 73 |
73 return result; | 74 return result; |
74 } | 75 } |
75 | 76 |
76 } // namespace content | 77 } // namespace content |
OLD | NEW |