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

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

Issue 9232075: Have ScopedClipboardWriter and Clipboard::WriteObjects take a buffer parameter. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix build error. Created 8 years, 10 months 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 | « ui/views/controls/textfield/textfield_views_model_unittest.cc ('k') | no next file » | 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 ScopedClipboardWriterGlue::ScopedClipboardWriterGlue( 8 ScopedClipboardWriterGlue::ScopedClipboardWriterGlue(
9 webkit_glue::ClipboardClient* client) 9 webkit_glue::ClipboardClient* client)
10 : ui::ScopedClipboardWriter(client->GetClipboard()), 10 : ui::ScopedClipboardWriter(client->GetClipboard(),
11 ui::Clipboard::BUFFER_STANDARD),
11 context_(client->CreateWriteContext()) { 12 context_(client->CreateWriteContext()) {
12 // We should never have an instance where both are set. 13 // We should never have an instance where both are set.
13 DCHECK((clipboard_ && !context_) || 14 DCHECK((clipboard_ && !context_) ||
14 (!clipboard_ && context_)); 15 (!clipboard_ && context_));
15 } 16 }
16 17
17 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() { 18 ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
18 if (!objects_.empty() && context_) { 19 if (!objects_.empty() && context_) {
19 context_->FlushAndDestroy(objects_); 20 context_->FlushAndDestroy(objects_);
20 } 21 }
21 } 22 }
22 23
23 void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels, 24 void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
24 const gfx::Size& size) { 25 const gfx::Size& size) {
25 if (context_) { 26 if (context_) {
26 context_->WriteBitmapFromPixels(&objects_, pixels, size); 27 context_->WriteBitmapFromPixels(&objects_, pixels, size);
27 } else { 28 } else {
28 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size); 29 ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
29 } 30 }
30 } 31 }
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield_views_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698