This source file includes following definitions.
- context_
- WriteBitmapFromPixels
#include "content/renderer/scoped_clipboard_writer_glue.h"
#include "base/logging.h"
namespace content {
ScopedClipboardWriterGlue::ScopedClipboardWriterGlue(ClipboardClient* client)
: ui::ScopedClipboardWriter(client->GetClipboard(),
ui::CLIPBOARD_TYPE_COPY_PASTE),
context_(client->CreateWriteContext()) {
DCHECK((clipboard_ && !context_.get()) ||
(!clipboard_ && context_.get()));
}
ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
if (!objects_.empty() && context_) {
context_->Flush(objects_);
}
}
void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
const gfx::Size& size) {
if (context_) {
context_->WriteBitmapFromPixels(&objects_, pixels, size);
} else {
NOTREACHED();
}
}
}