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 #include "remoting/host/clipboard.h" | 5 #include "remoting/host/clipboard.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 reinterpret_cast<RemoveClipboardFormatListenerFn*>( | 153 reinterpret_cast<RemoveClipboardFormatListenerFn*>( |
154 ::GetProcAddress(user32_module, "RemoveClipboardFormatListener")); | 154 ::GetProcAddress(user32_module, "RemoveClipboardFormatListener")); |
155 if (!HaveClipboardListenerApi()) { | 155 if (!HaveClipboardListenerApi()) { |
156 LOG(WARNING) << "Couldn't load AddClipboardFormatListener or " | 156 LOG(WARNING) << "Couldn't load AddClipboardFormatListener or " |
157 << "RemoveClipboardFormatListener."; | 157 << "RemoveClipboardFormatListener."; |
158 } | 158 } |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 if (!RegisterWindowClass()) { | 162 if (!RegisterWindowClass()) { |
163 LOG(FATAL) << "Couldn't register clipboard window class."; | 163 LOG(ERROR) << "Couldn't register clipboard window class."; |
164 return; | 164 return; |
165 } | 165 } |
166 hwnd_ = ::CreateWindow(kWindowClassName, | 166 hwnd_ = ::CreateWindow(kWindowClassName, |
167 kWindowName, | 167 kWindowName, |
168 0, 0, 0, 0, 0, | 168 0, 0, 0, 0, 0, |
169 HWND_MESSAGE, | 169 HWND_MESSAGE, |
170 NULL, | 170 NULL, |
171 base::GetModuleFromAddress(&WndProc), | 171 base::GetModuleFromAddress(&WndProc), |
172 this); | 172 this); |
173 if (!hwnd_) { | 173 if (!hwnd_) { |
174 LOG(FATAL) << "Couldn't create clipboard window."; | 174 LOG(ERROR) << "Couldn't create clipboard window."; |
175 return; | 175 return; |
176 } | 176 } |
177 | 177 |
178 if (HaveClipboardListenerApi()) { | 178 if (HaveClipboardListenerApi()) { |
179 if (!(*add_clipboard_format_listener_)(hwnd_)) { | 179 if (!(*add_clipboard_format_listener_)(hwnd_)) { |
180 LOG(WARNING) << "AddClipboardFormatListener() failed: " << GetLastError(); | 180 LOG(WARNING) << "AddClipboardFormatListener() failed: " << GetLastError(); |
181 } | 181 } |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 return 0; | 311 return 0; |
312 } | 312 } |
313 return ::DefWindowProc(hwnd, msg, wparam, lparam); | 313 return ::DefWindowProc(hwnd, msg, wparam, lparam); |
314 } | 314 } |
315 | 315 |
316 scoped_ptr<Clipboard> Clipboard::Create() { | 316 scoped_ptr<Clipboard> Clipboard::Create() { |
317 return scoped_ptr<Clipboard>(new ClipboardWin()); | 317 return scoped_ptr<Clipboard>(new ClipboardWin()); |
318 } | 318 } |
319 | 319 |
320 } // namespace remoting | 320 } // namespace remoting |
OLD | NEW |