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

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

Issue 211383007: Use FilePaths in content::DropData to avoid redundant conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang-format Created 6 years, 9 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 std::make_pair(item.stringType, item.stringData)); 48 std::make_pair(item.stringType, item.stringData));
49 break; 49 break;
50 } 50 }
51 case WebDragData::Item::StorageTypeBinaryData: 51 case WebDragData::Item::StorageTypeBinaryData:
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( 58 result.filenames.push_back(ui::FileInfo(
59 DropData::FileInfo(item.filenameData, item.displayNameData)); 59 base::FilePath::FromUTF16Unsafe(item.filenameData),
60 base::FilePath::FromUTF16Unsafe(item.displayNameData)));
60 break; 61 break;
61 } 62 }
62 } 63 }
63 64
64 return result; 65 return result;
65 } 66 }
66 67
67 } // namespace content 68 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698