Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Side by Side Diff: content/renderer/renderer_clipboard_client.cc

Issue 8775025: Add glue for supporting custom MIME types in DataTransfer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698