| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_ |
| 6 #define REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_ |
| 7 |
| 8 // altbase.h must be included before atlapp.h |
| 9 #include <atlbase.h> |
| 10 #include <atlapp.h> |
| 11 #include <atlcrack.h> |
| 12 #include <atlstr.h> |
| 13 #include <atluser.h> |
| 14 #include <atlwin.h> |
| 15 #include <string> |
| 16 |
| 17 #include "base/basictypes.h" |
| 18 #include "net/url_request/url_request_context_getter.h" |
| 19 #include "remoting/host/setup/win/auth_code_getter.h" |
| 20 #include "remoting/host/setup/host_starter.h" |
| 21 #include "remoting/host/setup/win/host_configurer_resource.h" |
| 22 |
| 23 namespace remoting { |
| 24 |
| 25 // A dialog box that lets the user register and start a host. |
| 26 class StartHostWindow : public ATL::CDialogImpl<StartHostWindow> { |
| 27 public: |
| 28 enum { IDD = IDD_START_HOST }; |
| 29 |
| 30 BEGIN_MSG_MAP_EX(StartHostWindowWin) |
| 31 MSG_WM_INITDIALOG(OnInitDialog) |
| 32 MSG_WM_CLOSE(OnClose) |
| 33 COMMAND_ID_HANDLER_EX(IDC_CONSENT, OnConsent) |
| 34 COMMAND_ID_HANDLER_EX(IDOK, OnOk) |
| 35 COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel) |
| 36 END_MSG_MAP() |
| 37 |
| 38 StartHostWindow( |
| 39 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter); |
| 40 |
| 41 private: |
| 42 void OnCancel(UINT code, int id, HWND control); |
| 43 void OnClose(); |
| 44 LRESULT OnInitDialog(HWND wparam, LPARAM lparam); |
| 45 void OnConsent(UINT code, int id, HWND control); |
| 46 void OnOk(UINT code, int id, HWND control); |
| 47 void OnAuthCode(const std::string& auth_code); |
| 48 void OnHostStarted(remoting::HostStarter::Result result); |
| 49 |
| 50 // Gets the text associated with an item in this dialog box. |
| 51 std::string GetDlgItemString(int id); |
| 52 |
| 53 remoting::AuthCodeGetter auth_code_getter_; |
| 54 scoped_ptr<remoting::HostStarter> host_starter_; |
| 55 |
| 56 // Data read from widgets in the dialog box. |
| 57 std::string host_name_; |
| 58 std::string pin_; |
| 59 bool consent_to_collect_data_; |
| 60 |
| 61 // A string manager that lets us use CSimpleString. |
| 62 CWin32Heap mem_mgr_; |
| 63 CAtlStringMgr string_mgr_; |
| 64 |
| 65 // WeakPtr used to avoid AuthCodeGetter or HostStarter callbacks accessing |
| 66 // this dialog box after it's closed. |
| 67 base::WeakPtrFactory<StartHostWindow> weak_ptr_factory_; |
| 68 base::WeakPtr<StartHostWindow> weak_ptr_; |
| 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(StartHostWindow); |
| 71 }; |
| 72 |
| 73 } // namespace remoting |
| 74 |
| 75 #endif // REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_ |
| OLD | NEW |