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