| 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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 597 |
| 598 HDROP drop = static_cast<HDROP>(::GetClipboardData(CF_HDROP)); | 598 HDROP drop = static_cast<HDROP>(::GetClipboardData(CF_HDROP)); |
| 599 if (!drop) | 599 if (!drop) |
| 600 return; | 600 return; |
| 601 | 601 |
| 602 // Count of files in the HDROP. | 602 // Count of files in the HDROP. |
| 603 int count = ::DragQueryFile(drop, 0xffffffff, NULL, 0); | 603 int count = ::DragQueryFile(drop, 0xffffffff, NULL, 0); |
| 604 | 604 |
| 605 if (count) { | 605 if (count) { |
| 606 for (int i = 0; i < count; ++i) { | 606 for (int i = 0; i < count; ++i) { |
| 607 int size = ::DragQueryFile(drop, i, NULL, 0) + 1; | 607 UINT size = ::DragQueryFile(drop, i, NULL, 0) + 1; |
| 608 DCHECK_GT(size, 1u); |
| 608 std::wstring file; | 609 std::wstring file; |
| 609 ::DragQueryFile(drop, i, WriteInto(&file, size), size); | 610 ::DragQueryFile(drop, i, WriteInto(&file, size), size); |
| 610 files->push_back(FilePath(file)); | 611 files->push_back(FilePath(file)); |
| 611 } | 612 } |
| 612 } | 613 } |
| 613 } | 614 } |
| 614 | 615 |
| 615 void Clipboard::ReadData(const std::string& format, std::string* result) { | 616 void Clipboard::ReadData(const std::string& format, std::string* result) { |
| 616 if (!result) { | 617 if (!result) { |
| 617 NOTREACHED(); | 618 NOTREACHED(); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 738 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
| 738 L"ClipboardOwnerWindow", | 739 L"ClipboardOwnerWindow", |
| 739 0, 0, 0, 0, 0, | 740 0, 0, 0, 0, 0, |
| 740 HWND_MESSAGE, | 741 HWND_MESSAGE, |
| 741 0, 0, 0); | 742 0, 0, 0); |
| 742 } | 743 } |
| 743 return clipboard_owner_; | 744 return clipboard_owner_; |
| 744 } | 745 } |
| 745 | 746 |
| 746 } // namespace ui | 747 } // namespace ui |
| OLD | NEW |