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