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 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/process/memory.h" | |
14 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
15 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/win/current_module.h" | |
16 #include "remoting/host/continue_window.h" | 16 #include "remoting/host/continue_window.h" |
17 #include "remoting/host/win/core_resource.h" | 17 #include "remoting/host/win/core_resource.h" |
18 | 18 |
19 namespace remoting { | 19 namespace remoting { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class ContinueWindowWin : public ContinueWindow { | 23 class ContinueWindowWin : public ContinueWindow { |
24 public: | 24 public: |
25 ContinueWindowWin(); | 25 ContinueWindowWin(); |
(...skipping 22 matching lines...) Expand all Loading... | |
48 } | 48 } |
49 | 49 |
50 ContinueWindowWin::~ContinueWindowWin() { | 50 ContinueWindowWin::~ContinueWindowWin() { |
51 EndDialog(); | 51 EndDialog(); |
52 } | 52 } |
53 | 53 |
54 void ContinueWindowWin::ShowUi() { | 54 void ContinueWindowWin::ShowUi() { |
55 DCHECK(CalledOnValidThread()); | 55 DCHECK(CalledOnValidThread()); |
56 DCHECK(!hwnd_); | 56 DCHECK(!hwnd_); |
57 | 57 |
58 HMODULE instance = base::GetModuleFromAddress(&DialogProc); | 58 hwnd_ = CreateDialogParam(CURRENT_MODULE(), MAKEINTRESOURCE(IDD_CONTINUE), |
59 hwnd_ = CreateDialogParam(instance, MAKEINTRESOURCE(IDD_CONTINUE), nullptr, | 59 nullptr, (DLGPROC)DialogProc, (LPARAM) this); |
joedow
2016/04/04 15:37:01
Why the extra space for 'this' and not in front of
Nico
2016/04/04 15:43:07
Excellent question. clang-format put it there, but
| |
60 (DLGPROC)DialogProc, (LPARAM)this); | |
61 if (!hwnd_) { | 60 if (!hwnd_) { |
62 LOG(ERROR) << "Unable to create Disconnect dialog for remoting."; | 61 LOG(ERROR) << "Unable to create Disconnect dialog for remoting."; |
63 return; | 62 return; |
64 } | 63 } |
65 | 64 |
66 ShowWindow(hwnd_, SW_SHOW); | 65 ShowWindow(hwnd_, SW_SHOW); |
67 } | 66 } |
68 | 67 |
69 void ContinueWindowWin::HideUi() { | 68 void ContinueWindowWin::HideUi() { |
70 DCHECK(CalledOnValidThread()); | 69 DCHECK(CalledOnValidThread()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 } | 126 } |
128 | 127 |
129 } // namespace | 128 } // namespace |
130 | 129 |
131 // static | 130 // static |
132 scoped_ptr<HostWindow> HostWindow::CreateContinueWindow() { | 131 scoped_ptr<HostWindow> HostWindow::CreateContinueWindow() { |
133 return make_scoped_ptr(new ContinueWindowWin()); | 132 return make_scoped_ptr(new ContinueWindowWin()); |
134 } | 133 } |
135 | 134 |
136 } // namespace remoting | 135 } // namespace remoting |
OLD | NEW |