| 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 | 239 |
| 240 // Writes file system files to the pickle. | 240 // Writes file system files to the pickle. |
| 241 void WriteFileSystemFilesToPickle( | 241 void WriteFileSystemFilesToPickle( |
| 242 const std::vector<DropData::FileSystemFileInfo>& file_system_files, | 242 const std::vector<DropData::FileSystemFileInfo>& file_system_files, |
| 243 base::Pickle* pickle) { | 243 base::Pickle* pickle) { |
| 244 pickle->WriteUInt32(file_system_files.size()); | 244 pickle->WriteUInt32(file_system_files.size()); |
| 245 for (size_t i = 0; i < file_system_files.size(); ++i) { | 245 for (size_t i = 0; i < file_system_files.size(); ++i) { |
| 246 pickle->WriteString(file_system_files[i].url.spec()); | 246 pickle->WriteString(file_system_files[i].url.spec()); |
| 247 pickle->WriteInt64(file_system_files[i].size); | 247 pickle->WriteInt64(file_system_files[i].size); |
| 248 pickle->WriteString(file_system_files[i].filesystem_id); |
| 248 } | 249 } |
| 249 } | 250 } |
| 250 | 251 |
| 251 // Reads file system files from the pickle. | 252 // Reads file system files from the pickle. |
| 252 bool ReadFileSystemFilesFromPickle( | 253 bool ReadFileSystemFilesFromPickle( |
| 253 const base::Pickle& pickle, | 254 const base::Pickle& pickle, |
| 254 std::vector<DropData::FileSystemFileInfo>* file_system_files) { | 255 std::vector<DropData::FileSystemFileInfo>* file_system_files) { |
| 255 base::PickleIterator iter(pickle); | 256 base::PickleIterator iter(pickle); |
| 256 | 257 |
| 257 uint32_t num_files = 0; | 258 uint32_t num_files = 0; |
| 258 if (!iter.ReadUInt32(&num_files)) | 259 if (!iter.ReadUInt32(&num_files)) |
| 259 return false; | 260 return false; |
| 260 file_system_files->resize(num_files); | 261 file_system_files->resize(num_files); |
| 261 | 262 |
| 262 for (uint32_t i = 0; i < num_files; ++i) { | 263 for (uint32_t i = 0; i < num_files; ++i) { |
| 263 std::string url_string; | 264 std::string url_string; |
| 264 int64_t size = 0; | 265 int64_t size = 0; |
| 265 if (!iter.ReadString(&url_string) || !iter.ReadInt64(&size)) | 266 std::string filesystem_id; |
| 267 if (!iter.ReadString(&url_string) || !iter.ReadInt64(&size) || |
| 268 !iter.ReadString(&filesystem_id)) { |
| 266 return false; | 269 return false; |
| 270 } |
| 267 | 271 |
| 268 GURL url(url_string); | 272 GURL url(url_string); |
| 269 if (!url.is_valid()) | 273 if (!url.is_valid()) |
| 270 return false; | 274 return false; |
| 271 | 275 |
| 272 (*file_system_files)[i].url = url; | 276 (*file_system_files)[i].url = url; |
| 273 (*file_system_files)[i].size = size; | 277 (*file_system_files)[i].size = size; |
| 278 (*file_system_files)[i].filesystem_id = filesystem_id; |
| 274 } | 279 } |
| 275 return true; | 280 return true; |
| 276 } | 281 } |
| 277 | 282 |
| 278 // Utility to fill a ui::OSExchangeDataProvider object from DropData. | 283 // Utility to fill a ui::OSExchangeDataProvider object from DropData. |
| 279 void PrepareDragData(const DropData& drop_data, | 284 void PrepareDragData(const DropData& drop_data, |
| 280 ui::OSExchangeData::Provider* provider, | 285 ui::OSExchangeData::Provider* provider, |
| 281 WebContentsImpl* web_contents) { | 286 WebContentsImpl* web_contents) { |
| 282 provider->MarkOriginatedFromRenderer(); | 287 provider->MarkOriginatedFromRenderer(); |
| 283 #if defined(OS_WIN) | 288 #if defined(OS_WIN) |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 bool allow_multiple_selection) { | 1255 bool allow_multiple_selection) { |
| 1251 NOTIMPLEMENTED() << " show " << items.size() << " menu items"; | 1256 NOTIMPLEMENTED() << " show " << items.size() << " menu items"; |
| 1252 } | 1257 } |
| 1253 | 1258 |
| 1254 void WebContentsViewAura::HidePopupMenu() { | 1259 void WebContentsViewAura::HidePopupMenu() { |
| 1255 NOTIMPLEMENTED(); | 1260 NOTIMPLEMENTED(); |
| 1256 } | 1261 } |
| 1257 #endif | 1262 #endif |
| 1258 | 1263 |
| 1259 } // namespace content | 1264 } // namespace content |
| OLD | NEW |