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 WebKit::WebDragData; | 14 using blink::WebDragData; |
15 using WebKit::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.referrer_policy = WebKit::WebReferrerPolicyDefault; | 22 result.referrer_policy = blink::WebReferrerPolicyDefault; |
23 | 23 |
24 const WebVector<WebDragData::Item>& item_list = drag_data.items(); | 24 const WebVector<WebDragData::Item>& item_list = drag_data.items(); |
25 for (size_t i = 0; i < item_list.size(); ++i) { | 25 for (size_t i = 0; i < item_list.size(); ++i) { |
26 const WebDragData::Item& item = item_list[i]; | 26 const WebDragData::Item& item = item_list[i]; |
27 switch (item.storageType) { | 27 switch (item.storageType) { |
28 case WebDragData::Item::StorageTypeString: { | 28 case WebDragData::Item::StorageTypeString: { |
29 if (EqualsASCII(item.stringType, ui::Clipboard::kMimeTypeText)) { | 29 if (EqualsASCII(item.stringType, ui::Clipboard::kMimeTypeText)) { |
30 result.text = base::NullableString16(item.stringData, false); | 30 result.text = base::NullableString16(item.stringData, false); |
31 break; | 31 break; |
32 } | 32 } |
(...skipping 25 matching lines...) Expand all Loading... |
58 result.filenames.push_back( | 58 result.filenames.push_back( |
59 DropData::FileInfo(item.filenameData, item.displayNameData)); | 59 DropData::FileInfo(item.filenameData, item.displayNameData)); |
60 break; | 60 break; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 return result; | 64 return result; |
65 } | 65 } |
66 | 66 |
67 } // namespace content | 67 } // namespace content |
OLD | NEW |