Chromium Code Reviews| 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 <atluser.h> | |
| 13 #include <atlwin.h> | |
| 14 #include <string> | |
| 15 | |
| 16 #include "base/basictypes.h" | |
| 17 #include "net/url_request/url_request_context_getter.h" | |
| 18 #include "remoting/host/setup/auth_code_getter_win.h" | |
| 19 #include "remoting/host/setup/host_starter.h" | |
| 20 #include "remoting/host/setup/win/host_configurer_resource.h" | |
| 21 | |
| 22 namespace remoting { | |
| 23 | |
| 24 // A dialog box that lets the user register and start a host. | |
| 25 class StartHostWindow : public ATL::CDialogImpl<StartHostWindow> { | |
| 26 public: | |
| 27 enum { IDD = IDD_START_HOST }; | |
| 28 | |
| 29 BEGIN_MSG_MAP_EX(StartHostWindowWin) | |
| 30 MSG_WM_INITDIALOG(OnInitDialog) | |
| 31 MSG_WM_CLOSE(OnClose) | |
| 32 COMMAND_ID_HANDLER_EX(IDC_CONSENT, OnConsent) | |
| 33 COMMAND_ID_HANDLER_EX(IDOK, OnOk) | |
| 34 COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel) | |
| 35 END_MSG_MAP() | |
| 36 | |
| 37 StartHostWindow(net::URLRequestContextGetter* url_request_context_getter); | |
| 38 | |
| 39 private: | |
| 40 void OnCancel(UINT code, int id, HWND control); | |
| 41 void OnClose(); | |
| 42 LRESULT OnInitDialog(HWND wparam, LPARAM lparam); | |
| 43 void OnConsent(UINT code, int id, HWND control); | |
| 44 void OnOk(UINT code, int id, HWND control); | |
| 45 void OnAuthCode(const std::string& auth_code); | |
| 46 void OnHostStarted(remoting::HostStarter::Result result); | |
| 47 | |
| 48 // Gets the text associated with an item in this dialog box. | |
| 49 std::string GetDlgItemString(int id); | |
| 50 | |
| 51 remoting::AuthCodeGetter auth_code_getter_; | |
| 52 scoped_ptr<remoting::HostStarter> host_starter_; | |
| 53 // Data read from widgets in the dialog box. | |
|
alexeypa (please no reviews)
2012/10/12 17:09:35
nit: Add an empty line before the comment.
simonmorris
2012/10/15 16:51:42
Done.
| |
| 54 std::string host_name_; | |
| 55 std::string pin_; | |
| 56 bool consent_to_collect_data_; | |
| 57 | |
| 58 // WeakPtr used to avoid AuthCodeGetter or HostStarter callbacks accessing | |
| 59 // this dialog box after it's closed. | |
| 60 base::WeakPtrFactory<StartHostWindow> weak_factory_; | |
| 61 base::WeakPtr<StartHostWindow> weak_ptr_; | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(StartHostWindow); | |
| 64 }; | |
| 65 | |
| 66 } // namespace remoting | |
| 67 | |
| 68 #endif // REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_ | |
| OLD | NEW |