Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: content/renderer/drop_data_builder.cc

Issue 1686263008: Add utility method for WebString to base::FilePath conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase! Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/URLConversion.h" 12 #include "third_party/WebKit/public/platform/URLConversion.h"
12 #include "third_party/WebKit/public/platform/WebDragData.h" 13 #include "third_party/WebKit/public/platform/WebDragData.h"
13 #include "third_party/WebKit/public/platform/WebString.h" 14 #include "third_party/WebKit/public/platform/WebString.h"
14 #include "third_party/WebKit/public/platform/WebVector.h" 15 #include "third_party/WebKit/public/platform/WebVector.h"
15 #include "ui/base/clipboard/clipboard.h" 16 #include "ui/base/clipboard/clipboard.h"
16 17
17 using blink::WebDragData; 18 using blink::WebDragData;
18 using blink::WebVector; 19 using blink::WebVector;
19 20
20 namespace content { 21 namespace content {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 break; 54 break;
54 } 55 }
55 case WebDragData::Item::StorageTypeBinaryData: 56 case WebDragData::Item::StorageTypeBinaryData:
56 result.file_contents.assign(item.binaryData.data(), 57 result.file_contents.assign(item.binaryData.data(),
57 item.binaryData.size()); 58 item.binaryData.size());
58 result.file_description_filename = item.title; 59 result.file_description_filename = item.title;
59 break; 60 break;
60 case WebDragData::Item::StorageTypeFilename: 61 case WebDragData::Item::StorageTypeFilename:
61 // TODO(varunjain): This only works on chromeos. Support win/mac/gtk. 62 // TODO(varunjain): This only works on chromeos. Support win/mac/gtk.
62 result.filenames.push_back(ui::FileInfo( 63 result.filenames.push_back(ui::FileInfo(
63 base::FilePath::FromUTF16Unsafe(item.filenameData), 64 blink::WebStringToFilePath(item.filenameData),
64 base::FilePath::FromUTF16Unsafe(item.displayNameData))); 65 blink::WebStringToFilePath(item.displayNameData)));
65 break; 66 break;
66 case WebDragData::Item::StorageTypeFileSystemFile: { 67 case WebDragData::Item::StorageTypeFileSystemFile: {
67 DropData::FileSystemFileInfo info; 68 DropData::FileSystemFileInfo info;
68 info.url = item.fileSystemURL; 69 info.url = item.fileSystemURL;
69 info.size = item.fileSystemFileSize; 70 info.size = item.fileSystemFileSize;
70 result.file_system_files.push_back(info); 71 result.file_system_files.push_back(info);
71 break; 72 break;
72 } 73 }
73 } 74 }
74 } 75 }
75 76
76 return result; 77 return result;
77 } 78 }
78 79
79 } // namespace content 80 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webfileutilities_impl.cc ('k') | content/renderer/pepper/url_response_info_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698