OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (item_list_[i]->Kind() == DataObjectItem::kStringKind && | 161 if (item_list_[i]->Kind() == DataObjectItem::kStringKind && |
162 item_list_[i]->GetType() == type) | 162 item_list_[i]->GetType() == type) |
163 return item_list_[i]->GetAsString(); | 163 return item_list_[i]->GetAsString(); |
164 } | 164 } |
165 return String(); | 165 return String(); |
166 } | 166 } |
167 | 167 |
168 void DataObject::SetData(const String& type, const String& data) { | 168 void DataObject::SetData(const String& type, const String& data) { |
169 ClearData(type); | 169 ClearData(type); |
170 if (!Add(data, type)) | 170 if (!Add(data, type)) |
171 ASSERT_NOT_REACHED(); | 171 NOTREACHED(); |
172 } | 172 } |
173 | 173 |
174 void DataObject::UrlAndTitle(String& url, String* title) const { | 174 void DataObject::UrlAndTitle(String& url, String* title) const { |
175 DataObjectItem* item = FindStringItem(kMimeTypeTextURIList); | 175 DataObjectItem* item = FindStringItem(kMimeTypeTextURIList); |
176 if (!item) | 176 if (!item) |
177 return; | 177 return; |
178 url = ConvertURIListToURL(item->GetAsString()); | 178 url = ConvertURIListToURL(item->GetAsString()); |
179 if (title) | 179 if (title) |
180 *title = item->Title(); | 180 *title = item->Title(); |
181 } | 181 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 item.file_system_file_size = file->size(); | 348 item.file_system_file_size = file->size(); |
349 item.file_system_id = original_item->FileSystemId(); | 349 item.file_system_id = original_item->FileSystemId(); |
350 } else { | 350 } else { |
351 // FIXME: support dragging constructed Files across renderers, see | 351 // FIXME: support dragging constructed Files across renderers, see |
352 // http://crbug.com/394955 | 352 // http://crbug.com/394955 |
353 item.storage_type = WebDragData::Item::kStorageTypeString; | 353 item.storage_type = WebDragData::Item::kStorageTypeString; |
354 item.string_type = "text/plain"; | 354 item.string_type = "text/plain"; |
355 item.string_data = file->name(); | 355 item.string_data = file->name(); |
356 } | 356 } |
357 } else { | 357 } else { |
358 ASSERT_NOT_REACHED(); | 358 NOTREACHED(); |
359 } | 359 } |
360 } else { | 360 } else { |
361 ASSERT_NOT_REACHED(); | 361 NOTREACHED(); |
362 } | 362 } |
363 } else { | 363 } else { |
364 ASSERT_NOT_REACHED(); | 364 NOTREACHED(); |
365 } | 365 } |
366 item_list[i] = item; | 366 item_list[i] = item; |
367 } | 367 } |
368 data.SwapItems(item_list); | 368 data.SwapItems(item_list); |
369 return data; | 369 return data; |
370 } | 370 } |
371 | 371 |
372 } // namespace blink | 372 } // namespace blink |
OLD | NEW |