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