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

Side by Side Diff: webkit/glue/scoped_clipboard_writer_glue.cc

Issue 11225021: Move flash clipboard to the new proxy and add custom format support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "webkit/glue/scoped_clipboard_writer_glue.h" 5 #include "webkit/glue/scoped_clipboard_writer_glue.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 namespace webkit_glue {
9
8 ScopedClipboardWriterGlue::ScopedClipboardWriterGlue( 10 ScopedClipboardWriterGlue::ScopedClipboardWriterGlue(
9 webkit_glue::ClipboardClient* client) 11 webkit_glue::ClipboardClient* client)
10 : ui::ScopedClipboardWriter(client->GetClipboard(), 12 : ui::ScopedClipboardWriter(client->GetClipboard(),
11 ui::Clipboard::BUFFER_STANDARD), 13 ui::Clipboard::BUFFER_STANDARD),
12 context_(client->CreateWriteContext()) { 14 context_(client->CreateWriteContext()) {
13 // We should never have an instance where both are set. 15 // We should never have an instance where both are set.
14 DCHECK((clipboard_ && !context_.get()) || 16 DCHECK((clipboard_ && !context_.get()) ||
15 (!clipboard_ && context_.get())); 17 (!clipboard_ && context_.get()));
16 } 18 }
17 19
18 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() { 20 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
19 if (!objects_.empty() && context_.get()) { 21 if (!objects_.empty() && context_.get()) {
20 context_->Flush(objects_); 22 context_->Flush(objects_);
21 } 23 }
22 } 24 }
23 25
24 void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels, 26 void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
25 const gfx::Size& size) { 27 const gfx::Size& size) {
26 if (context_.get()) { 28 if (context_.get()) {
27 context_->WriteBitmapFromPixels(&objects_, pixels, size); 29 context_->WriteBitmapFromPixels(&objects_, pixels, size);
28 } else { 30 } else {
29 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size); 31 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
30 } 32 }
31 } 33 }
34
35 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/plugins/ppapi/mock_plugin_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698