OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 Loading... |
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 852 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
851 L"ClipboardOwnerWindow", | 853 L"ClipboardOwnerWindow", |
852 0, 0, 0, 0, 0, | 854 0, 0, 0, 0, 0, |
853 HWND_MESSAGE, | 855 HWND_MESSAGE, |
854 0, 0, 0); | 856 0, 0, 0); |
855 } | 857 } |
856 return clipboard_owner_; | 858 return clipboard_owner_; |
857 } | 859 } |
858 | 860 |
859 } // namespace ui | 861 } // namespace ui |
OLD | NEW |