| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 for (const WebString& type : webTypes) { | 55 for (const WebString& type : webTypes) { |
| 56 if (pasteMode == PlainTextOnly && type != mimeTypeTextPlain) | 56 if (pasteMode == PlainTextOnly && type != mimeTypeTextPlain) |
| 57 continue; | 57 continue; |
| 58 dataObject->m_itemList.append( | 58 dataObject->m_itemList.append( |
| 59 DataObjectItem::createFromPasteboard(type, sequenceNumber)); | 59 DataObjectItem::createFromPasteboard(type, sequenceNumber)); |
| 60 ASSERT(typesSeen.add(type).isNewEntry); | 60 ASSERT(typesSeen.add(type).isNewEntry); |
| 61 } | 61 } |
| 62 return dataObject; | 62 return dataObject; |
| 63 } | 63 } |
| 64 | 64 |
| 65 DataObject* DataObject::createFromString(const String& data) { |
| 66 DataObject* dataObject = create(); |
| 67 dataObject->add(data, mimeTypeTextPlain); |
| 68 return dataObject; |
| 69 } |
| 70 |
| 65 DataObject* DataObject::create() { | 71 DataObject* DataObject::create() { |
| 66 return new DataObject; | 72 return new DataObject; |
| 67 } | 73 } |
| 68 | 74 |
| 69 DataObject::~DataObject() {} | 75 DataObject::~DataObject() {} |
| 70 | 76 |
| 71 size_t DataObject::length() const { | 77 size_t DataObject::length() const { |
| 72 return m_itemList.size(); | 78 return m_itemList.size(); |
| 73 } | 79 } |
| 74 | 80 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 336 } |
| 331 item.title = originalItem->title(); | 337 item.title = originalItem->title(); |
| 332 item.baseURL = originalItem->baseURL(); | 338 item.baseURL = originalItem->baseURL(); |
| 333 itemList[i] = item; | 339 itemList[i] = item; |
| 334 } | 340 } |
| 335 data.swapItems(itemList); | 341 data.swapItems(itemList); |
| 336 return data; | 342 return data; |
| 337 } | 343 } |
| 338 | 344 |
| 339 } // namespace blink | 345 } // namespace blink |
| OLD | NEW |