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

Unified Diff: webkit/glue/scoped_clipboard_writer_glue.cc

Issue 8591030: Move clipboard-related webkit_glue embedder functions into a ClipboardClient interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/glue/webclipboard_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/scoped_clipboard_writer_glue.cc
diff --git a/webkit/glue/scoped_clipboard_writer_glue.cc b/webkit/glue/scoped_clipboard_writer_glue.cc
new file mode 100644
index 0000000000000000000000000000000000000000..be4ccac856a565b9c92445d9a3aa3bd08c89c9a9
--- /dev/null
+++ b/webkit/glue/scoped_clipboard_writer_glue.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/glue/scoped_clipboard_writer_glue.h"
+
+ScopedClipboardWriterGlue::ScopedClipboardWriterGlue(
+ webkit_glue::ClipboardClient* client)
+ : ui::ScopedClipboardWriter(client->GetClipboard()),
+ context_(client->CreateWriteContext()) {
+}
+
+ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
+ if (context_)
+ context_->FlushAndDestroy(objects_);
+}
+
+void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
+ const gfx::Size& size) {
+ if (context_) {
+ context_->WriteBitmapFromPixels(&objects_, pixels, size);
+ } else {
+ ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
+ }
+}
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/glue/webclipboard_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698