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

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

Issue 242643004: Support drag and drop of files with filesystem: URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix SEGV during tests Created 6 years, 8 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 | Annotate | Revision Log
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 "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"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 result.file_contents.assign(item.binaryData.data(), 52 result.file_contents.assign(item.binaryData.data(),
53 item.binaryData.size()); 53 item.binaryData.size());
54 result.file_description_filename = item.title; 54 result.file_description_filename = item.title;
55 break; 55 break;
56 case WebDragData::Item::StorageTypeFilename: 56 case WebDragData::Item::StorageTypeFilename:
57 // TODO(varunjain): This only works on chromeos. Support win/mac/gtk. 57 // TODO(varunjain): This only works on chromeos. Support win/mac/gtk.
58 result.filenames.push_back(ui::FileInfo( 58 result.filenames.push_back(ui::FileInfo(
59 base::FilePath::FromUTF16Unsafe(item.filenameData), 59 base::FilePath::FromUTF16Unsafe(item.filenameData),
60 base::FilePath::FromUTF16Unsafe(item.displayNameData))); 60 base::FilePath::FromUTF16Unsafe(item.displayNameData)));
61 break; 61 break;
62 default: // TODO(hashimoto): Remove this "default". 62 case WebDragData::Item::StorageTypeFileSystemFile: {
63 NOTREACHED(); 63 DropData::FileSystemFileInfo info;
64 info.url = item.fileSystemURL;
65 info.size = item.fileSystemFileSize;
66 result.file_system_files.push_back(info);
67 break;
68 }
64 } 69 }
65 } 70 }
66 71
67 return result; 72 return result;
68 } 73 }
69 74
70 } // namespace content 75 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698