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/process/memory.h" | 12 #include "base/process/memory.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "remoting/host/continue_window.h" | 15 #include "remoting/host/continue_window.h" |
16 #include "remoting/host/win/core_resource.h" | 16 #include "remoting/host/win/core_resource.h" |
17 | 17 |
18 namespace remoting { | 18 namespace remoting { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class ContinueWindowWin : public ContinueWindow { | 22 class ContinueWindowWin : public ContinueWindow { |
23 public: | 23 public: |
24 explicit ContinueWindowWin(const UiStrings& ui_strings); | 24 ContinueWindowWin(); |
25 virtual ~ContinueWindowWin(); | 25 virtual ~ContinueWindowWin(); |
26 | 26 |
27 protected: | 27 protected: |
28 // ContinueWindow overrides. | 28 // ContinueWindow overrides. |
29 virtual void ShowUi() OVERRIDE; | 29 virtual void ShowUi() OVERRIDE; |
30 virtual void HideUi() OVERRIDE; | 30 virtual void HideUi() OVERRIDE; |
31 | 31 |
32 private: | 32 private: |
33 static BOOL CALLBACK DialogProc(HWND hwmd, UINT msg, WPARAM wParam, | 33 static BOOL CALLBACK DialogProc(HWND hwmd, UINT msg, WPARAM wParam, |
34 LPARAM lParam); | 34 LPARAM lParam); |
35 | 35 |
36 BOOL OnDialogMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); | 36 BOOL OnDialogMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); |
37 | 37 |
38 void EndDialog(); | 38 void EndDialog(); |
39 | 39 |
40 HWND hwnd_; | 40 HWND hwnd_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(ContinueWindowWin); | 42 DISALLOW_COPY_AND_ASSIGN(ContinueWindowWin); |
43 }; | 43 }; |
44 | 44 |
45 ContinueWindowWin::ContinueWindowWin(const UiStrings& ui_strings) | 45 ContinueWindowWin::ContinueWindowWin() |
46 : ContinueWindow(ui_strings), | 46 : hwnd_(NULL) { |
47 hwnd_(NULL) { | |
48 } | 47 } |
49 | 48 |
50 ContinueWindowWin::~ContinueWindowWin() { | 49 ContinueWindowWin::~ContinueWindowWin() { |
51 EndDialog(); | 50 EndDialog(); |
52 } | 51 } |
53 | 52 |
54 void ContinueWindowWin::ShowUi() { | 53 void ContinueWindowWin::ShowUi() { |
55 DCHECK(CalledOnValidThread()); | 54 DCHECK(CalledOnValidThread()); |
56 DCHECK(!hwnd_); | 55 DCHECK(!hwnd_); |
57 | 56 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 121 |
123 if (hwnd_) { | 122 if (hwnd_) { |
124 ::DestroyWindow(hwnd_); | 123 ::DestroyWindow(hwnd_); |
125 hwnd_ = NULL; | 124 hwnd_ = NULL; |
126 } | 125 } |
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 const UiStrings& ui_strings) { | 132 return scoped_ptr<HostWindow>(new ContinueWindowWin()); |
134 return scoped_ptr<HostWindow>(new ContinueWindowWin(ui_strings)); | |
135 } | 133 } |
136 | 134 |
137 } // namespace remoting | 135 } // namespace remoting |
OLD | NEW |