| 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 26 matching lines...) Expand all Loading... |
| 37 #include "platform/clipboard/ClipboardUtilities.h" | 37 #include "platform/clipboard/ClipboardUtilities.h" |
| 38 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
| 39 #include "public/platform/WebClipboard.h" | 39 #include "public/platform/WebClipboard.h" |
| 40 #include "public/platform/WebDragData.h" | 40 #include "public/platform/WebDragData.h" |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 DataObject* DataObject::createFromPasteboard(PasteMode pasteMode) | 44 DataObject* DataObject::createFromPasteboard(PasteMode pasteMode) |
| 45 { | 45 { |
| 46 DataObject* dataObject = create(); | 46 DataObject* dataObject = create(); |
| 47 blink::WebClipboard::Buffer buffer = Pasteboard::generalPasteboard()->buffer
(); | 47 WebClipboard::Buffer buffer = Pasteboard::generalPasteboard()->buffer(); |
| 48 uint64_t sequenceNumber = blink::Platform::current()->clipboard()->sequenceN
umber(buffer); | 48 uint64_t sequenceNumber = Platform::current()->clipboard()->sequenceNumber(b
uffer); |
| 49 bool ignored; | 49 bool ignored; |
| 50 blink::WebVector<blink::WebString> webTypes = blink::Platform::current()->cl
ipboard()->readAvailableTypes(buffer, &ignored); | 50 WebVector<WebString> webTypes = Platform::current()->clipboard()->readAvaila
bleTypes(buffer, &ignored); |
| 51 ListHashSet<String> types; | 51 ListHashSet<String> types; |
| 52 for (size_t i = 0; i < webTypes.size(); ++i) | 52 for (size_t i = 0; i < webTypes.size(); ++i) |
| 53 types.add(webTypes[i]); | 53 types.add(webTypes[i]); |
| 54 for (const String& type : types) { | 54 for (const String& type : types) { |
| 55 if (pasteMode == PlainTextOnly && type != mimeTypeTextPlain) | 55 if (pasteMode == PlainTextOnly && type != mimeTypeTextPlain) |
| 56 continue; | 56 continue; |
| 57 dataObject->m_itemList.append(DataObjectItem::createFromPasteboard(type,
sequenceNumber)); | 57 dataObject->m_itemList.append(DataObjectItem::createFromPasteboard(type,
sequenceNumber)); |
| 58 } | 58 } |
| 59 return dataObject; | 59 return dataObject; |
| 60 } | 60 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 item.title = originalItem->title(); | 340 item.title = originalItem->title(); |
| 341 item.baseURL = originalItem->baseURL(); | 341 item.baseURL = originalItem->baseURL(); |
| 342 itemList[i] = item; | 342 itemList[i] = item; |
| 343 } | 343 } |
| 344 data.swapItems(itemList); | 344 data.swapItems(itemList); |
| 345 return data; | 345 return data; |
| 346 } | 346 } |
| 347 | 347 |
| 348 } // namespace blink | 348 } // namespace blink |
| OLD | NEW |