| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "third_party/WebKit/WebKit/chromium/public/WebData.h" | 7 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
| 8 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
| 12 | 12 |
| 13 using WebKit::WebData; | 13 using WebKit::WebData; |
| 14 using WebKit::WebDragData; | 14 using WebKit::WebDragData; |
| 15 using WebKit::WebString; | 15 using WebKit::WebString; |
| 16 using WebKit::WebVector; | 16 using WebKit::WebVector; |
| 17 | 17 |
| 18 WebDropData::WebDropData(const WebDragData& drag_data) | 18 WebDropData::WebDropData(const WebDragData& drag_data) |
| 19 : identity(0), | 19 : identity(0), |
| 20 url(drag_data.url()), | 20 url(drag_data.url()), |
| 21 url_title(drag_data.urlTitle()), | 21 url_title(drag_data.urlTitle()), |
| 22 download_url(drag_data.downloadURL()), |
| 22 file_extension(drag_data.fileExtension()), | 23 file_extension(drag_data.fileExtension()), |
| 23 plain_text(drag_data.plainText()), | 24 plain_text(drag_data.plainText()), |
| 24 text_html(drag_data.htmlText()), | 25 text_html(drag_data.htmlText()), |
| 25 html_base_url(drag_data.htmlBaseURL()), | 26 html_base_url(drag_data.htmlBaseURL()), |
| 26 file_description_filename(drag_data.fileContentFileName()) { | 27 file_description_filename(drag_data.fileContentFileName()) { |
| 27 if (drag_data.hasFileNames()) { | 28 if (drag_data.hasFileNames()) { |
| 28 WebVector<WebString> fileNames; | 29 WebVector<WebString> fileNames; |
| 29 drag_data.fileNames(fileNames); | 30 drag_data.fileNames(fileNames); |
| 30 for (size_t i = 0; i < fileNames.size(); ++i) | 31 for (size_t i = 0; i < fileNames.size(); ++i) |
| 31 filenames.push_back(fileNames[i]); | 32 filenames.push_back(fileNames[i]); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 42 result.setURLTitle(url_title); | 43 result.setURLTitle(url_title); |
| 43 result.setFileExtension(file_extension); | 44 result.setFileExtension(file_extension); |
| 44 result.setFileNames(filenames); | 45 result.setFileNames(filenames); |
| 45 result.setPlainText(plain_text); | 46 result.setPlainText(plain_text); |
| 46 result.setHTMLText(text_html); | 47 result.setHTMLText(text_html); |
| 47 result.setHTMLBaseURL(html_base_url); | 48 result.setHTMLBaseURL(html_base_url); |
| 48 result.setFileContentFileName(file_description_filename); | 49 result.setFileContentFileName(file_description_filename); |
| 49 result.setFileContent(WebData(file_contents.data(), file_contents.size())); | 50 result.setFileContent(WebData(file_contents.data(), file_contents.size())); |
| 50 return result; | 51 return result; |
| 51 } | 52 } |
| OLD | NEW |