Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1484)

Unified Diff: remoting/host/setup/win/start_host_window.h

Issue 11090063: [Chromoting] Add a simple Windows app that registers and starts a host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/setup/win/start_host_window.h
diff --git a/remoting/host/setup/win/start_host_window.h b/remoting/host/setup/win/start_host_window.h
new file mode 100644
index 0000000000000000000000000000000000000000..c406a63dafe497b30a63ebafce4e9f2094ed666c
--- /dev/null
+++ b/remoting/host/setup/win/start_host_window.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_
+#define REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_
+
+// altbase.h must be included before atlapp.h
+#include <atlbase.h>
+#include <atlapp.h>
+#include <atlcrack.h>
+#include <atluser.h>
+#include <atlwin.h>
+#include <string>
+
+#include "base/basictypes.h"
+#include "net/url_request/url_request_context_getter.h"
+#include "remoting/host/setup/auth_code_getter_win.h"
+#include "remoting/host/setup/host_starter.h"
+#include "remoting/host/setup/win/host_configurer_resource.h"
+
+namespace remoting {
+
+// A dialog box that lets the user register and start a host.
+class StartHostWindow : public ATL::CDialogImpl<StartHostWindow> {
+ public:
+ enum { IDD = IDD_START_HOST };
+
+ BEGIN_MSG_MAP_EX(StartHostWindowWin)
+ MSG_WM_INITDIALOG(OnInitDialog)
+ MSG_WM_CLOSE(OnClose)
+ COMMAND_ID_HANDLER_EX(IDC_CONSENT, OnConsent)
+ COMMAND_ID_HANDLER_EX(IDOK, OnOk)
+ COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
+ END_MSG_MAP()
+
+ StartHostWindow(net::URLRequestContextGetter* url_request_context_getter);
+
+ private:
+ void OnCancel(UINT code, int id, HWND control);
+ void OnClose();
+ LRESULT OnInitDialog(HWND wparam, LPARAM lparam);
+ void OnConsent(UINT code, int id, HWND control);
+ void OnOk(UINT code, int id, HWND control);
+ void OnAuthCode(const std::string& auth_code);
+ void OnHostStarted(remoting::HostStarter::Result result);
+
+ // Gets the text associated with an item in this dialog box.
+ std::string GetDlgItemString(int id);
+
+ remoting::AuthCodeGetter auth_code_getter_;
+ scoped_ptr<remoting::HostStarter> host_starter_;
+ // 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.
+ std::string host_name_;
+ std::string pin_;
+ bool consent_to_collect_data_;
+
+ // WeakPtr used to avoid AuthCodeGetter or HostStarter callbacks accessing
+ // this dialog box after it's closed.
+ base::WeakPtrFactory<StartHostWindow> weak_factory_;
+ base::WeakPtr<StartHostWindow> weak_ptr_;
+
+ DISALLOW_COPY_AND_ASSIGN(StartHostWindow);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_

Powered by Google App Engine
This is Rietveld 408576698