| 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 #include "content/browser/renderer_host/clipboard_message_filter.h" | 5 #include "content/browser/renderer_host/clipboard_message_filter.h" |
| 6 | 6 |
| 7 #if defined(USE_SYSTEM_ZLIB) | 7 #if defined(USE_SYSTEM_ZLIB) |
| 8 #include <zlib.h> | 8 #include <zlib.h> |
| 9 #else | 9 #else |
| 10 #include "third_party/zlib/zlib.h" | 10 #include "third_party/zlib/zlib.h" |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "content/browser/clipboard_dispatcher.h" | 14 #include "content/browser/clipboard_dispatcher.h" |
| 15 #include "content/common/clipboard_messages.h" | 15 #include "content/common/clipboard_messages.h" |
| 16 #include "content/public/browser/content_browser_client.h" | 16 #include "content/public/browser/content_browser_client.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
| 19 #include "third_party/skia/include/core/SkBitmap.h" | 19 #include "third_party/skia/include/core/SkBitmap.h" |
| 20 #include "ui/gfx/codec/png_codec.h" | 20 #include "ui/gfx/codec/png_codec.h" |
| 21 #include "ui/gfx/size.h" | 21 #include "ui/gfx/size.h" |
| 22 | 22 |
| 23 using content::BrowserThread; |
| 24 |
| 23 namespace { | 25 namespace { |
| 24 | 26 |
| 25 // Completes a clipboard write initiated by the renderer. The write must be | 27 // Completes a clipboard write initiated by the renderer. The write must be |
| 26 // performed on the UI thread because the clipboard service from the IO thread | 28 // performed on the UI thread because the clipboard service from the IO thread |
| 27 // cannot create windows so it cannot be the "owner" of the clipboard's | 29 // cannot create windows so it cannot be the "owner" of the clipboard's |
| 28 // contents. | 30 // contents. |
| 29 class WriteClipboardTask : public Task { | 31 class WriteClipboardTask : public Task { |
| 30 public: | 32 public: |
| 31 explicit WriteClipboardTask(ui::Clipboard::ObjectMap* objects) | 33 explicit WriteClipboardTask(ui::Clipboard::ObjectMap* objects) |
| 32 : objects_(objects) {} | 34 : objects_(objects) {} |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 220 } |
| 219 | 221 |
| 220 // static | 222 // static |
| 221 ui::Clipboard* ClipboardMessageFilter::GetClipboard() { | 223 ui::Clipboard* ClipboardMessageFilter::GetClipboard() { |
| 222 // We have a static instance of the clipboard service for use by all message | 224 // We have a static instance of the clipboard service for use by all message |
| 223 // filters. This instance lives for the life of the browser processes. | 225 // filters. This instance lives for the life of the browser processes. |
| 224 static ui::Clipboard* clipboard = new ui::Clipboard; | 226 static ui::Clipboard* clipboard = new ui::Clipboard; |
| 225 | 227 |
| 226 return clipboard; | 228 return clipboard; |
| 227 } | 229 } |
| OLD | NEW |