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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 // static | 820 // static |
821 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { | 821 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { |
822 CR_DEFINE_STATIC_LOCAL( | 822 CR_DEFINE_STATIC_LOCAL( |
823 FormatType, | 823 FormatType, |
824 type, | 824 type, |
825 (ClipboardUtil::GetWebCustomDataFormat()->cfFormat)); | 825 (ClipboardUtil::GetWebCustomDataFormat()->cfFormat)); |
826 return type; | 826 return type; |
827 } | 827 } |
828 | 828 |
829 // static | 829 // static |
| 830 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { |
| 831 CR_DEFINE_STATIC_LOCAL( |
| 832 FormatType, |
| 833 type, |
| 834 (ClipboardUtil::GetPepperCustomDataFormat()->cfFormat)); |
| 835 return type; |
| 836 } |
| 837 |
| 838 // static |
830 void Clipboard::FreeData(unsigned int format, HANDLE data) { | 839 void Clipboard::FreeData(unsigned int format, HANDLE data) { |
831 if (format == CF_BITMAP) | 840 if (format == CF_BITMAP) |
832 ::DeleteObject(static_cast<HBITMAP>(data)); | 841 ::DeleteObject(static_cast<HBITMAP>(data)); |
833 else | 842 else |
834 ::GlobalFree(data); | 843 ::GlobalFree(data); |
835 } | 844 } |
836 | 845 |
837 HWND Clipboard::GetClipboardWindow() const { | 846 HWND Clipboard::GetClipboardWindow() const { |
838 if (!clipboard_owner_ && create_window_) { | 847 if (!clipboard_owner_ && create_window_) { |
839 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 848 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
840 L"ClipboardOwnerWindow", | 849 L"ClipboardOwnerWindow", |
841 0, 0, 0, 0, 0, | 850 0, 0, 0, 0, 0, |
842 HWND_MESSAGE, | 851 HWND_MESSAGE, |
843 0, 0, 0); | 852 0, 0, 0); |
844 } | 853 } |
845 return clipboard_owner_; | 854 return clipboard_owner_; |
846 } | 855 } |
847 | 856 |
848 } // namespace ui | 857 } // namespace ui |
OLD | NEW |