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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 for (int i = 0; i < count; ++i) { | 613 for (int i = 0; i < count; ++i) { |
614 UINT size = ::DragQueryFile(drop, i, NULL, 0) + 1; | 614 UINT size = ::DragQueryFile(drop, i, NULL, 0) + 1; |
615 DCHECK_GT(size, 1u); | 615 DCHECK_GT(size, 1u); |
616 std::wstring file; | 616 std::wstring file; |
617 ::DragQueryFile(drop, i, WriteInto(&file, size), size); | 617 ::DragQueryFile(drop, i, WriteInto(&file, size), size); |
618 files->push_back(FilePath(file)); | 618 files->push_back(FilePath(file)); |
619 } | 619 } |
620 } | 620 } |
621 } | 621 } |
622 | 622 |
623 void Clipboard::ReadData(const std::string& format, std::string* result) { | 623 void Clipboard::ReadData(const std::string& format, std::string* result) const { |
624 if (!result) { | 624 if (!result) { |
625 NOTREACHED(); | 625 NOTREACHED(); |
626 return; | 626 return; |
627 } | 627 } |
628 | 628 |
629 CLIPFORMAT clip_format = | 629 CLIPFORMAT clip_format = |
630 ::RegisterClipboardFormat(ASCIIToWide(format).c_str()); | 630 ::RegisterClipboardFormat(ASCIIToWide(format).c_str()); |
631 | 631 |
632 ScopedClipboard clipboard; | 632 ScopedClipboard clipboard; |
633 if (!clipboard.Acquire(GetClipboardWindow())) | 633 if (!clipboard.Acquire(GetClipboardWindow())) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 745 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
746 L"ClipboardOwnerWindow", | 746 L"ClipboardOwnerWindow", |
747 0, 0, 0, 0, 0, | 747 0, 0, 0, 0, 0, |
748 HWND_MESSAGE, | 748 HWND_MESSAGE, |
749 0, 0, 0); | 749 0, 0, 0); |
750 } | 750 } |
751 return clipboard_owner_; | 751 return clipboard_owner_; |
752 } | 752 } |
753 | 753 |
754 } // namespace ui | 754 } // namespace ui |
OLD | NEW |