OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "content/common/clipboard_messages.h" | 11 #include "content/common/clipboard_messages.h" |
12 #include "content/public/renderer/content_renderer_client.h" | 12 #include "content/public/renderer/content_renderer_client.h" |
13 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
14 #include "ui/base/clipboard/clipboard.h" | 14 #include "ui/base/clipboard/clipboard.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 #include "webkit/glue/scoped_clipboard_writer_glue.h" | 16 #include "webkit/glue/scoped_clipboard_writer_glue.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class RendererClipboardWriteContext : | 22 class RendererClipboardWriteContext : |
23 public webkit_glue::ClipboardClient::WriteContext { | 23 public webkit_glue::ClipboardClient::WriteContext { |
24 public: | 24 public: |
25 RendererClipboardWriteContext(); | 25 RendererClipboardWriteContext(); |
26 virtual ~RendererClipboardWriteContext(); | 26 virtual ~RendererClipboardWriteContext(); |
27 virtual void WriteBitmapFromPixels(ui::Clipboard::ObjectMap* objects, | 27 virtual void WriteBitmapFromPixels(ui::Clipboard::ObjectMap* objects, |
28 const void* pixels, | 28 const void* pixels, |
29 const gfx::Size& size); | 29 const gfx::Size& size) OVERRIDE; |
30 virtual void Flush(const ui::Clipboard::ObjectMap& objects); | 30 virtual void Flush(const ui::Clipboard::ObjectMap& objects) OVERRIDE; |
31 | 31 |
32 private: | 32 private: |
33 scoped_ptr<base::SharedMemory> shared_buf_; | 33 scoped_ptr<base::SharedMemory> shared_buf_; |
34 DISALLOW_COPY_AND_ASSIGN(RendererClipboardWriteContext); | 34 DISALLOW_COPY_AND_ASSIGN(RendererClipboardWriteContext); |
35 }; | 35 }; |
36 | 36 |
37 RendererClipboardWriteContext::RendererClipboardWriteContext() { | 37 RendererClipboardWriteContext::RendererClipboardWriteContext() { |
38 } | 38 } |
39 | 39 |
40 RendererClipboardWriteContext::~RendererClipboardWriteContext() { | 40 RendererClipboardWriteContext::~RendererClipboardWriteContext() { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 RenderThreadImpl::current()->Send( | 183 RenderThreadImpl::current()->Send( |
184 new ClipboardHostMsg_ReadData(format, data)); | 184 new ClipboardHostMsg_ReadData(format, data)); |
185 } | 185 } |
186 | 186 |
187 webkit_glue::ClipboardClient::WriteContext* | 187 webkit_glue::ClipboardClient::WriteContext* |
188 RendererClipboardClient::CreateWriteContext() { | 188 RendererClipboardClient::CreateWriteContext() { |
189 return new RendererClipboardWriteContext; | 189 return new RendererClipboardWriteContext; |
190 } | 190 } |
191 | 191 |
192 } // namespace content | 192 } // namespace content |
OLD | NEW |