| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file provides the embedder's side of random webkit glue functions. | 5 // This file provides the embedder's side of random webkit glue functions. |
| 6 | 6 |
| 7 #include "content/renderer/renderer_clipboard_client.h" | 7 #include "content/renderer/renderer_clipboard_client.h" |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 uint32 image_size; | 162 uint32 image_size; |
| 163 RenderThreadImpl::current()->Send( | 163 RenderThreadImpl::current()->Send( |
| 164 new ClipboardHostMsg_ReadImage(buffer, &image_handle, &image_size)); | 164 new ClipboardHostMsg_ReadImage(buffer, &image_handle, &image_size)); |
| 165 if (base::SharedMemory::IsHandleValid(image_handle)) { | 165 if (base::SharedMemory::IsHandleValid(image_handle)) { |
| 166 base::SharedMemory buffer(image_handle, true); | 166 base::SharedMemory buffer(image_handle, true); |
| 167 buffer.Map(image_size); | 167 buffer.Map(image_size); |
| 168 data->append(static_cast<char*>(buffer.memory()), image_size); | 168 data->append(static_cast<char*>(buffer.memory()), image_size); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 void RendererClipboardClient::ReadCustomData(ui::Clipboard::Buffer buffer, |
| 173 const string16& type, |
| 174 string16* data) { |
| 175 RenderThreadImpl::current()->Send( |
| 176 new ClipboardHostMsg_ReadCustomData(buffer, type, data)); |
| 177 } |
| 178 |
| 172 webkit_glue::ClipboardClient::WriteContext* | 179 webkit_glue::ClipboardClient::WriteContext* |
| 173 RendererClipboardClient::CreateWriteContext() { | 180 RendererClipboardClient::CreateWriteContext() { |
| 174 return new RendererClipboardWriteContext; | 181 return new RendererClipboardWriteContext; |
| 175 } | 182 } |
| OLD | NEW |