OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebDragData.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebDragData.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
17 #include "ui/base/clipboard/clipboard.h" | 17 #include "ui/base/clipboard/clipboard.h" |
18 | 18 |
19 using WebKit::WebData; | 19 using WebKit::WebData; |
20 using WebKit::WebDragData; | 20 using WebKit::WebDragData; |
21 using WebKit::WebString; | 21 using WebKit::WebString; |
22 using WebKit::WebVector; | 22 using WebKit::WebVector; |
23 | 23 |
24 WebDropData::FileInfo::FileInfo() { | 24 WebDropData::FileInfo::FileInfo() { |
25 } | 25 } |
26 | 26 |
27 WebDropData::FileInfo::FileInfo(const string16& path, | 27 WebDropData::FileInfo::FileInfo(const base::string16& path, |
28 const string16& display_name) | 28 const base::string16& display_name) |
29 : path(path), | 29 : path(path), |
30 display_name(display_name) { | 30 display_name(display_name) { |
31 } | 31 } |
32 | 32 |
33 WebDropData::WebDropData(const WebDragData& drag_data) | 33 WebDropData::WebDropData(const WebDragData& drag_data) |
34 : referrer_policy(WebKit::WebReferrerPolicyDefault), | 34 : referrer_policy(WebKit::WebReferrerPolicyDefault), |
35 text(NullableString16(true)), | 35 text(NullableString16(true)), |
36 html(NullableString16(true)) { | 36 html(NullableString16(true)) { |
37 const WebVector<WebDragData::Item>& item_list = drag_data.items(); | 37 const WebVector<WebDragData::Item>& item_list = drag_data.items(); |
38 for (size_t i = 0; i < item_list.size(); ++i) { | 38 for (size_t i = 0; i < item_list.size(); ++i) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 for (std::vector<FileInfo>::const_iterator it = | 122 for (std::vector<FileInfo>::const_iterator it = |
123 filenames.begin(); it != filenames.end(); ++it) { | 123 filenames.begin(); it != filenames.end(); ++it) { |
124 WebDragData::Item item; | 124 WebDragData::Item item; |
125 item.storageType = WebDragData::Item::StorageTypeFilename; | 125 item.storageType = WebDragData::Item::StorageTypeFilename; |
126 item.filenameData = it->path; | 126 item.filenameData = it->path; |
127 item.displayNameData = it->display_name; | 127 item.displayNameData = it->display_name; |
128 item_list.push_back(item); | 128 item_list.push_back(item); |
129 } | 129 } |
130 | 130 |
131 for (std::map<string16, string16>::const_iterator it = custom_data.begin(); | 131 for (std::map<base::string16, base::string16>::const_iterator it = |
| 132 custom_data.begin(); |
132 it != custom_data.end(); | 133 it != custom_data.end(); |
133 ++it) { | 134 ++it) { |
134 WebDragData::Item item; | 135 WebDragData::Item item; |
135 item.storageType = WebDragData::Item::StorageTypeString; | 136 item.storageType = WebDragData::Item::StorageTypeString; |
136 item.stringType = it->first; | 137 item.stringType = it->first; |
137 item.stringData = it->second; | 138 item.stringData = it->second; |
138 item_list.push_back(item); | 139 item_list.push_back(item); |
139 } | 140 } |
140 | 141 |
141 WebDragData result; | 142 WebDragData result; |
142 result.initialize(); | 143 result.initialize(); |
143 result.setItems(item_list); | 144 result.setItems(item_list); |
144 result.setFilesystemId(filesystem_id); | 145 result.setFilesystemId(filesystem_id); |
145 return result; | 146 return result; |
146 } | 147 } |
OLD | NEW |