OLD | NEW |
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 clipboard_owner_ = NULL; | 201 clipboard_owner_ = NULL; |
202 } | 202 } |
203 | 203 |
204 Clipboard::~Clipboard() { | 204 Clipboard::~Clipboard() { |
205 if (clipboard_owner_) | 205 if (clipboard_owner_) |
206 ::DestroyWindow(clipboard_owner_); | 206 ::DestroyWindow(clipboard_owner_); |
207 clipboard_owner_ = NULL; | 207 clipboard_owner_ = NULL; |
208 } | 208 } |
209 | 209 |
210 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { | 210 void Clipboard::WriteObjectsImpl(Buffer buffer, const ObjectMap& objects) { |
211 DCHECK_EQ(buffer, BUFFER_STANDARD); | 211 DCHECK_EQ(buffer, BUFFER_STANDARD); |
212 | 212 |
213 ScopedClipboard clipboard; | 213 ScopedClipboard clipboard; |
214 if (!clipboard.Acquire(GetClipboardWindow())) | 214 if (!clipboard.Acquire(GetClipboardWindow())) |
215 return; | 215 return; |
216 | 216 |
217 ::EmptyClipboard(); | 217 ::EmptyClipboard(); |
218 | 218 |
219 for (ObjectMap::const_iterator iter = objects.begin(); | 219 for (ObjectMap::const_iterator iter = objects.begin(); |
220 iter != objects.end(); ++iter) { | 220 iter != objects.end(); ++iter) { |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 848 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
849 L"ClipboardOwnerWindow", | 849 L"ClipboardOwnerWindow", |
850 0, 0, 0, 0, 0, | 850 0, 0, 0, 0, 0, |
851 HWND_MESSAGE, | 851 HWND_MESSAGE, |
852 0, 0, 0); | 852 0, 0, 0); |
853 } | 853 } |
854 return clipboard_owner_; | 854 return clipboard_owner_; |
855 } | 855 } |
856 | 856 |
857 } // namespace ui | 857 } // namespace ui |
OLD | NEW |