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

Side by Side Diff: ui/base/clipboard/clipboard_win.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/base/clipboard/clipboard_unittest.cc ('k') | ui/base/clipboard/scoped_clipboard_writer.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 // Many of these functions are based on those found in 5 // Many of these functions are based on those found in
6 // webkit/port/platform/PasteboardWin.cpp 6 // webkit/port/platform/PasteboardWin.cpp
7 7
8 #include "ui/base/clipboard/clipboard.h" 8 #include "ui/base/clipboard/clipboard.h"
9 9
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 clipboard_owner_ = NULL; 200 clipboard_owner_ = NULL;
201 } 201 }
202 202
203 Clipboard::~Clipboard() { 203 Clipboard::~Clipboard() {
204 if (clipboard_owner_) 204 if (clipboard_owner_)
205 ::DestroyWindow(clipboard_owner_); 205 ::DestroyWindow(clipboard_owner_);
206 clipboard_owner_ = NULL; 206 clipboard_owner_ = NULL;
207 } 207 }
208 208
209 void Clipboard::WriteObjects(const ObjectMap& objects) { 209 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) {
210 DCHECK_EQ(buffer, BUFFER_STANDARD);
211
210 ScopedClipboard clipboard; 212 ScopedClipboard clipboard;
211 if (!clipboard.Acquire(GetClipboardWindow())) 213 if (!clipboard.Acquire(GetClipboardWindow()))
212 return; 214 return;
213 215
214 ::EmptyClipboard(); 216 ::EmptyClipboard();
215 217
216 for (ObjectMap::const_iterator iter = objects.begin(); 218 for (ObjectMap::const_iterator iter = objects.begin();
217 iter != objects.end(); ++iter) { 219 iter != objects.end(); ++iter) {
218 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); 220 DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
219 } 221 }
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", 805 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
804 L"ClipboardOwnerWindow", 806 L"ClipboardOwnerWindow",
805 0, 0, 0, 0, 0, 807 0, 0, 0, 0, 0,
806 HWND_MESSAGE, 808 HWND_MESSAGE,
807 0, 0, 0); 809 0, 0, 0);
808 } 810 }
809 return clipboard_owner_; 811 return clipboard_owner_;
810 } 812 }
811 813
812 } // namespace ui 814 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_unittest.cc ('k') | ui/base/clipboard/scoped_clipboard_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698