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 <windows.h> | 5 #include <windows.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/process/memory.h" | |
12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/win/current_module.h" |
14 #include "base/win/scoped_gdi_object.h" | 14 #include "base/win/scoped_gdi_object.h" |
15 #include "base/win/scoped_hdc.h" | 15 #include "base/win/scoped_hdc.h" |
16 #include "base/win/scoped_select_object.h" | 16 #include "base/win/scoped_select_object.h" |
17 #include "remoting/host/client_session_control.h" | 17 #include "remoting/host/client_session_control.h" |
18 #include "remoting/host/host_window.h" | 18 #include "remoting/host/host_window.h" |
19 #include "remoting/host/win/core_resource.h" | 19 #include "remoting/host/win/core_resource.h" |
20 | 20 |
21 namespace remoting { | 21 namespace remoting { |
22 | 22 |
23 namespace { | 23 namespace { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return TRUE; | 223 return TRUE; |
224 } | 224 } |
225 } | 225 } |
226 return FALSE; | 226 return FALSE; |
227 } | 227 } |
228 | 228 |
229 bool DisconnectWindowWin::BeginDialog() { | 229 bool DisconnectWindowWin::BeginDialog() { |
230 DCHECK(CalledOnValidThread()); | 230 DCHECK(CalledOnValidThread()); |
231 DCHECK(!hwnd_); | 231 DCHECK(!hwnd_); |
232 | 232 |
233 HMODULE module = base::GetModuleFromAddress(&DialogProc); | 233 hwnd_ = |
234 hwnd_ = CreateDialogParam(module, MAKEINTRESOURCE(IDD_DISCONNECT), nullptr, | 234 CreateDialogParam(CURRENT_MODULE(), MAKEINTRESOURCE(IDD_DISCONNECT), |
235 DialogProc, reinterpret_cast<LPARAM>(this)); | 235 nullptr, DialogProc, reinterpret_cast<LPARAM>(this)); |
236 if (!hwnd_) | 236 if (!hwnd_) |
237 return false; | 237 return false; |
238 | 238 |
239 // Set up handler for Ctrl-Alt-Esc shortcut. | 239 // Set up handler for Ctrl-Alt-Esc shortcut. |
240 if (!has_hotkey_ && RegisterHotKey(hwnd_, DISCONNECT_HOTKEY_ID, | 240 if (!has_hotkey_ && RegisterHotKey(hwnd_, DISCONNECT_HOTKEY_ID, |
241 MOD_ALT | MOD_CONTROL, VK_ESCAPE)) { | 241 MOD_ALT | MOD_CONTROL, VK_ESCAPE)) { |
242 has_hotkey_ = true; | 242 has_hotkey_ = true; |
243 } | 243 } |
244 | 244 |
245 if (!SetStrings()) | 245 if (!SetStrings()) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 } | 393 } |
394 | 394 |
395 } // namespace | 395 } // namespace |
396 | 396 |
397 // static | 397 // static |
398 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { | 398 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { |
399 return make_scoped_ptr(new DisconnectWindowWin()); | 399 return make_scoped_ptr(new DisconnectWindowWin()); |
400 } | 400 } |
401 | 401 |
402 } // namespace remoting | 402 } // namespace remoting |
OLD | NEW |