| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Google Inc. | 3 * Copyright (C) 2008, 2009 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 RefPtr<ChromiumDataObjectItem> item = m_dataObject->item(index); | 99 RefPtr<ChromiumDataObjectItem> item = m_dataObject->item(index); |
| 100 if (!item) | 100 if (!item) |
| 101 return 0; | 101 return 0; |
| 102 | 102 |
| 103 return DataTransferItemPolicyWrapper::create(m_clipboard, item); | 103 return DataTransferItemPolicyWrapper::create(m_clipboard, item); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void DataTransferItemListPolicyWrapper::deleteItem(unsigned long index, Exceptio
nCode& ec) | 106 void DataTransferItemListPolicyWrapper::deleteItem(unsigned long index, Exceptio
nCode& ec) |
| 107 { | 107 { |
| 108 if (!m_clipboard->canWriteData()) { | 108 if (!m_clipboard->canWriteData()) { |
| 109 ec = INVALID_STATE_ERR; | 109 ec = InvalidStateError; |
| 110 return; | 110 return; |
| 111 } | 111 } |
| 112 m_dataObject->deleteItem(index); | 112 m_dataObject->deleteItem(index); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void DataTransferItemListPolicyWrapper::clear() | 115 void DataTransferItemListPolicyWrapper::clear() |
| 116 { | 116 { |
| 117 if (!m_clipboard->canWriteData()) | 117 if (!m_clipboard->canWriteData()) |
| 118 return; | 118 return; |
| 119 m_dataObject->clearAll(); | 119 m_dataObject->clearAll(); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 PassRefPtr<DataTransferItemList> ClipboardChromium::items() | 461 PassRefPtr<DataTransferItemList> ClipboardChromium::items() |
| 462 { | 462 { |
| 463 // FIXME: According to the spec, we are supposed to return the same collecti
on of items each | 463 // FIXME: According to the spec, we are supposed to return the same collecti
on of items each |
| 464 // time. We now return a wrapper that always wraps the *same* set of items,
so JS shouldn't be | 464 // time. We now return a wrapper that always wraps the *same* set of items,
so JS shouldn't be |
| 465 // able to tell, but we probably still want to fix this. | 465 // able to tell, but we probably still want to fix this. |
| 466 return DataTransferItemListPolicyWrapper::create(this, m_dataObject); | 466 return DataTransferItemListPolicyWrapper::create(this, m_dataObject); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace WebCore | 469 } // namespace WebCore |
| OLD | NEW |