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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 clipboard_owner_ = NULL; | 173 clipboard_owner_ = NULL; |
174 } | 174 } |
175 | 175 |
176 Clipboard::~Clipboard() { | 176 Clipboard::~Clipboard() { |
177 if (clipboard_owner_) | 177 if (clipboard_owner_) |
178 ::DestroyWindow(clipboard_owner_); | 178 ::DestroyWindow(clipboard_owner_); |
179 clipboard_owner_ = NULL; | 179 clipboard_owner_ = NULL; |
180 } | 180 } |
181 | 181 |
182 void Clipboard::WriteObjects(const ObjectMap& objects) { | 182 void Clipboard::WriteObjects(const ObjectMap& objects) { |
183 WriteObjects(objects, NULL); | |
184 } | |
185 | |
186 void Clipboard::WriteObjects(const ObjectMap& objects, | |
187 base::ProcessHandle process) { | |
188 ScopedClipboard clipboard; | 183 ScopedClipboard clipboard; |
189 if (!clipboard.Acquire(GetClipboardWindow())) | 184 if (!clipboard.Acquire(GetClipboardWindow())) |
190 return; | 185 return; |
191 | 186 |
192 ::EmptyClipboard(); | 187 ::EmptyClipboard(); |
193 | 188 |
194 for (ObjectMap::const_iterator iter = objects.begin(); | 189 for (ObjectMap::const_iterator iter = objects.begin(); |
195 iter != objects.end(); ++iter) { | 190 iter != objects.end(); ++iter) { |
196 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 191 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
197 } | 192 } |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 737 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
743 L"ClipboardOwnerWindow", | 738 L"ClipboardOwnerWindow", |
744 0, 0, 0, 0, 0, | 739 0, 0, 0, 0, 0, |
745 HWND_MESSAGE, | 740 HWND_MESSAGE, |
746 0, 0, 0); | 741 0, 0, 0); |
747 } | 742 } |
748 return clipboard_owner_; | 743 return clipboard_owner_; |
749 } | 744 } |
750 | 745 |
751 } // namespace ui | 746 } // namespace ui |
OLD | NEW |