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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 const std::string& serialization) { | 180 const std::string& serialization) { |
181 int clipboard_format = -1; | 181 int clipboard_format = -1; |
182 if (!base::StringToInt(serialization, &clipboard_format)) { | 182 if (!base::StringToInt(serialization, &clipboard_format)) { |
183 NOTREACHED(); | 183 NOTREACHED(); |
184 return FormatType(); | 184 return FormatType(); |
185 } | 185 } |
186 return FormatType(clipboard_format); | 186 return FormatType(clipboard_format); |
187 } | 187 } |
188 | 188 |
189 Clipboard::Clipboard() : create_window_(false) { | 189 Clipboard::Clipboard() : create_window_(false) { |
190 if (MessageLoop::current()->type() == MessageLoop::TYPE_UI) { | 190 if (base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI) { |
191 // Make a dummy HWND to be the clipboard's owner. | 191 // Make a dummy HWND to be the clipboard's owner. |
192 WNDCLASSEX window_class; | 192 WNDCLASSEX window_class; |
193 base::win::InitializeWindowClass( | 193 base::win::InitializeWindowClass( |
194 L"ClipboardOwnerWindowClass", | 194 L"ClipboardOwnerWindowClass", |
195 &base::win::WrappedWindowProc<ClipboardOwnerWndProc>, | 195 &base::win::WrappedWindowProc<ClipboardOwnerWndProc>, |
196 0, 0, 0, NULL, NULL, NULL, NULL, NULL, | 196 0, 0, 0, NULL, NULL, NULL, NULL, NULL, |
197 &window_class); | 197 &window_class); |
198 ::RegisterClassEx(&window_class); | 198 ::RegisterClassEx(&window_class); |
199 create_window_ = true; | 199 create_window_ = true; |
200 } | 200 } |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 873 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
874 L"ClipboardOwnerWindow", | 874 L"ClipboardOwnerWindow", |
875 0, 0, 0, 0, 0, | 875 0, 0, 0, 0, 0, |
876 HWND_MESSAGE, | 876 HWND_MESSAGE, |
877 0, 0, 0); | 877 0, 0, 0); |
878 } | 878 } |
879 return clipboard_owner_; | 879 return clipboard_owner_; |
880 } | 880 } |
881 | 881 |
882 } // namespace ui | 882 } // namespace ui |
OLD | NEW |