summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 10:01:39 +0000
committerweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 10:01:39 +0000
commitbf97e483cf6a5a0b3a0e5b7ea8b21a9fca6535ed (patch)
treeb03e45ddbcd0069ac0b4c1173b8b4e338455fd3d
parent7a72d45674bcd17b9bcabe8b37d316a6af5b923e (diff)
downloadchromium_src-bf97e483cf6a5a0b3a0e5b7ea8b21a9fca6535ed.zip
chromium_src-bf97e483cf6a5a0b3a0e5b7ea8b21a9fca6535ed.tar.gz
chromium_src-bf97e483cf6a5a0b3a0e5b7ea8b21a9fca6535ed.tar.bz2
Small refactoring of the remoting_host_setup_base target.
1. host_starter is only referenced in two rarely used binaries and shouldn't belong in setup_base. 2. setup_base is not needed by it2me. BUG= Review URL: https://codereview.chromium.org/114393002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240580 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/host/setup/win/host_configurer.cc64
-rw-r--r--remoting/host/setup/win/host_configurer.rc47
-rw-r--r--remoting/host/setup/win/host_configurer_resource.h28
-rw-r--r--remoting/host/setup/win/host_configurer_window.cc123
-rw-r--r--remoting/host/setup/win/host_configurer_window.h68
-rw-r--r--remoting/host/setup/win/load_string_from_resource.cc17
-rw-r--r--remoting/host/setup/win/load_string_from_resource.h19
-rw-r--r--remoting/host/setup/win/start_host_window.cc105
-rw-r--r--remoting/host/setup/win/start_host_window.h75
-rw-r--r--remoting/remoting.gyp41
10 files changed, 2 insertions, 585 deletions
diff --git a/remoting/host/setup/win/host_configurer.cc b/remoting/host/setup/win/host_configurer.cc
deleted file mode 100644
index 604c9e4..0000000
--- a/remoting/host/setup/win/host_configurer.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// 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.
-
-#include <atlbase.h>
-#include <atlwin.h>
-#include <ole2.h>
-
-#include "base/at_exit.h"
-#include "base/command_line.h"
-#include "base/run_loop.h"
-#include "base/threading/thread.h"
-#include "remoting/base/url_request_context.h"
-#include "remoting/host/setup/win/host_configurer_window.h"
-
-class HostConfigurerModule
- : public ATL::CAtlExeModuleT<HostConfigurerModule> {
-};
-
-HostConfigurerModule _AtlModule;
-
-// An app that runs a HostConfigurerWindow.
-int WINAPI WinMain(HINSTANCE instance_handle, HINSTANCE prev_instance_handle,
- LPSTR cmd_line, int cmd)
-{
- // google_apis::GetOAuth2ClientID/Secret need the next line.
- // On Windows, CommandLine::Init ignores its arguments, and parses
- // GetCommandLineW directly, so we can pass it dummy arguments.
- CommandLine::Init(0, NULL);
-
- // Register and initialize common controls.
- INITCOMMONCONTROLSEX info;
- info.dwSize = sizeof(info);
- info.dwICC = ICC_STANDARD_CLASSES;
- InitCommonControlsEx(&info);
-
- // This object instance is required by Chrome code (for example,
- // FilePath, LazyInstance, MessageLoop).
- base::AtExitManager exit_manager;
-
- // Provide message loops and threads for the URLRequestContextGetter.
- base::MessageLoop message_loop(base::MessageLoop::TYPE_UI);
- base::Thread io_thread("IO thread");
- base::Thread::Options io_thread_options(base::MessageLoop::TYPE_IO, 0);
- io_thread.StartWithOptions(io_thread_options);
-
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_(
- new remoting::URLRequestContextGetter(io_thread.message_loop_proxy()));
-
- OleInitialize(NULL);
-
- // Run a HostConfigurerWindow.
- remoting::HostConfigurerWindow host_configurer_window(
- url_request_context_getter_, message_loop.message_loop_proxy(),
- message_loop.QuitClosure());
- host_configurer_window.Create(NULL);
-
- base::RunLoop run_loop;
- run_loop.Run();
-
- io_thread.Stop();
-
- OleUninitialize();
-}
diff --git a/remoting/host/setup/win/host_configurer.rc b/remoting/host/setup/win/host_configurer.rc
deleted file mode 100644
index 786b321..0000000
--- a/remoting/host/setup/win/host_configurer.rc
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <windows.h>
-
-#include "host_configurer_resource.h"
-
-IDD_MAIN DIALOGEX 0, 0, 180, 74
-STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-FONT 8, "MS Sans Serif"
-{
- PUSHBUTTON "Start host" IDC_START_HOST, 65, 8, 50, 14
- PUSHBUTTON "Change PIN" IDC_CHANGE_PIN 65, 30, 50, 14
- PUSHBUTTON "Stop host" IDC_STOP_HOST 65, 52, 50, 14
-}
-
-IDD_START_HOST DIALOGEX 0, 0, 350, 120
-STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-FONT 8, "MS Sans Serif"
-{
- LTEXT "Host name", IDC_HOST_NAME_LABEL, 8, 10, 50, 14
- EDITTEXT IDC_HOST_NAME, 60, 8, 150, 14
- LTEXT "PIN", IDC_PIN_LABEL, 8, 30, 50, 14
- EDITTEXT IDC_PIN, 60, 28, 70, 14, ES_PASSWORD | ES_NUMBER
- LTEXT "Confirm PIN", IDC_CONFIRM_PIN_LABEL, 8, 50, 50, 14
- EDITTEXT IDC_CONFIRM_PIN, 60, 48, 70, 14, ES_PASSWORD | ES_NUMBER
- CHECKBOX "", IDC_CONSENT, 8, 68, 350, 30
- PUSHBUTTON "OK" IDOK, 8, 100, 50, 14
- PUSHBUTTON "Cancel" IDCANCEL, 66, 100, 50, 14
-}
-
-STRINGTABLE
-{
-#ifdef OFFICIAL_BUILD
- IDS_TITLE, "Chrome Remote Desktop Host Configurer"
- IDS_CONSENT, "Help us improve Chrome Remote Desktop by allowing us to collect \
- usage statistics and crash reports."
-#else
- IDS_TITLE, "Chromoting Host Configurer"
- IDS_CONSENT, "Help us improve Chromoting by allowing us to collect \
- usage statistics and crash reports."
-#endif
- IDS_SAME_PIN, "Please enter the same PIN in both boxes."
- IDS_HOST_START_SUCCEEDED, "The host has started."
- IDS_HOST_START_FAILED, "Couldn't start the host."
- IDS_INVALID_PIN, "Please choose a PIN of at least 6 digits."
- IDS_USE_BROWSER, "After you press OK, a browser will start. \
- Use it to sign on to your Google account, and to give \
- the host the permissions it needs."
-}
diff --git a/remoting/host/setup/win/host_configurer_resource.h b/remoting/host/setup/win/host_configurer_resource.h
deleted file mode 100644
index 9fac828..0000000
--- a/remoting/host/setup/win/host_configurer_resource.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// 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_HOST_CONFIGURER_RESOURCE_H_
-#define REMOTING_HOST_SETUP_WIN_HOST_CONFIGURER_RESOURCE_H_
-
-#define IDD_MAIN 101
-#define IDC_START_HOST 102
-#define IDC_STOP_HOST 103
-#define IDD_START_HOST 104
-#define IDC_HOST_NAME_LABEL 105
-#define IDC_HOST_NAME 106
-#define IDC_PIN_LABEL 107
-#define IDC_PIN 108
-#define IDC_CONFIRM_PIN_LABEL 109
-#define IDC_CONFIRM_PIN 110
-#define IDC_CONSENT 111
-#define IDS_TITLE 112
-#define IDS_SAME_PIN 113
-#define IDS_HOST_START_SUCCEEDED 114
-#define IDS_HOST_START_FAILED 115
-#define IDS_INVALID_PIN 116
-#define IDS_USE_BROWSER 117
-#define IDC_CHANGE_PIN 118
-#define IDS_CONSENT 119
-
-#endif // REMOTING_HOST_SETUP_WIN_HOST_CONFIGURER_RESOURCE_H_
diff --git a/remoting/host/setup/win/host_configurer_window.cc b/remoting/host/setup/win/host_configurer_window.cc
deleted file mode 100644
index d7dfb14..0000000
--- a/remoting/host/setup/win/host_configurer_window.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-// 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.
-
-#include "remoting/host/setup/win/host_configurer_window.h"
-
-#include <atlbase.h>
-#include <atlstr.h>
-#include <atlwin.h>
-#include <windows.h>
-
-#include "base/run_loop.h"
-#include "base/strings/string16.h"
-#include "remoting/host/setup/win/load_string_from_resource.h"
-#include "remoting/host/setup/win/start_host_window.h"
-
-namespace remoting {
-
-HostConfigurerWindow::HostConfigurerWindow(
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
- base::Closure on_destroy)
- : url_request_context_getter_(url_request_context_getter),
- ui_task_runner_(ui_task_runner),
- on_destroy_(on_destroy) {
-}
-
-void HostConfigurerWindow::OnCancel(UINT code, int id, HWND control) {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- Finish();
-}
-
-void HostConfigurerWindow::OnClose() {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- Finish();
-}
-
-LRESULT HostConfigurerWindow::OnInitDialog(HWND wparam, LPARAM lparam) {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- // Failure of any of these calls is acceptable.
- SetWindowText(LoadStringFromResource(IDS_TITLE));
- GetDlgItem(IDC_CHANGE_PIN).EnableWindow(FALSE);
- GetDlgItem(IDC_STOP_HOST).EnableWindow(FALSE);
- PositionWindow();
- return TRUE;
-}
-
-void HostConfigurerWindow::OnOk(UINT code, int id, HWND control) {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- Finish();
-}
-
-void HostConfigurerWindow::OnStartHost(UINT code, int id, HWND control) {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- StartHostWindow start_host_window(url_request_context_getter_);
- start_host_window.DoModal();
-}
-
-void HostConfigurerWindow::PositionWindow() {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- // Get the window dimensions.
- RECT rect;
- if (!GetWindowRect(&rect)) {
- return;
- }
-
- // Position against the owner window unless it is minimized or invisible.
- HWND owner = ::GetWindow(m_hWnd, GW_OWNER);
- if (owner != NULL) {
- DWORD style = ::GetWindowLong(owner, GWL_STYLE);
- if ((style & WS_MINIMIZE) != 0 || (style & WS_VISIBLE) == 0) {
- owner = NULL;
- }
- }
-
- // Make sure that the window will not end up split by a monitor's boundary.
- RECT area_rect;
- if (!::SystemParametersInfo(SPI_GETWORKAREA, NULL, &area_rect, NULL)) {
- return;
- }
-
- // On a multi-monitor system use the monitor where the owner window is shown.
- RECT owner_rect = area_rect;
- if (owner != NULL && ::GetWindowRect(owner, &owner_rect)) {
- HMONITOR monitor = ::MonitorFromRect(&owner_rect, MONITOR_DEFAULTTONEAREST);
- if (monitor != NULL) {
- MONITORINFO monitor_info = {0};
- monitor_info.cbSize = sizeof(monitor_info);
- if (::GetMonitorInfo(monitor, &monitor_info)) {
- area_rect = monitor_info.rcWork;
- }
- }
- }
-
- LONG width = rect.right - rect.left;
- LONG height = rect.bottom - rect.top;
- // Avoid the center of the owner rectangle, because the host controller will
- // put its confirmation window there.
- LONG x = (3 * owner_rect.left + owner_rect.right) / 4 - (width / 2);
- LONG y = (3 * owner_rect.top + owner_rect.bottom) / 4 - (height / 2);
-
- x = std::max(x, area_rect.left);
- x = std::min(x, area_rect.right - width);
- y = std::max(y, area_rect.top);
- y = std::min(y, area_rect.bottom - width);
-
- SetWindowPos(NULL, x, y, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
-}
-
-void HostConfigurerWindow::Finish() {
- DCHECK(ui_task_runner_->BelongsToCurrentThread());
-
- DestroyWindow();
- on_destroy_.Run();
-}
-
-} // namespace remoting
diff --git a/remoting/host/setup/win/host_configurer_window.h b/remoting/host/setup/win/host_configurer_window.h
deleted file mode 100644
index 3845619..0000000
--- a/remoting/host/setup/win/host_configurer_window.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// 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_HOST_CONFIGURER_WINDOW_H_
-#define REMOTING_HOST_SETUP_WIN_HOST_CONFIGURER_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 "base/callback.h"
-#include "net/url_request/url_request_context_getter.h"
-#include "remoting/host/setup/win/host_configurer_resource.h"
-
-namespace remoting {
-
-// This dialog is modeless, so that it can be created before its message loop
-// starts to run.
-class HostConfigurerWindow : public ATL::CDialogImpl<HostConfigurerWindow> {
- public:
- enum { IDD = IDD_MAIN };
-
- BEGIN_MSG_MAP_EX(HostConfigurerWindow)
- MSG_WM_INITDIALOG(OnInitDialog)
- MSG_WM_CLOSE(OnClose)
- COMMAND_ID_HANDLER_EX(IDC_START_HOST, OnStartHost)
- END_MSG_MAP()
-
- HostConfigurerWindow(
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter,
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
- base::Closure on_destroy);
-
- private:
- // All methods in this class must be called on the UI thread.
- void OnCancel(UINT code, int id, HWND control);
- void OnClose();
- LRESULT OnInitDialog(HWND wparam, LPARAM lparam);
- void OnOk(UINT code, int id, HWND control);
- void OnStartHost(UINT code, int id, HWND control);
-
- // Destroys the window and quits the UI message loop.
- void Finish();
-
- // Sets an appropriate initial position for the dialog.
- void PositionWindow();
-
- // Context needed to start the host.
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
-
- // The UI task runner.
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
-
- // A task used to notify the caller that this window has been destroyed.
- base::Closure on_destroy_;
-
- DISALLOW_COPY_AND_ASSIGN(HostConfigurerWindow);
-};
-
-} // namespace remoting
-
-#endif // REMOTING_HOST_SETUP_WIN_HOST_CONFIGURER_WINDOW_H_
diff --git a/remoting/host/setup/win/load_string_from_resource.cc b/remoting/host/setup/win/load_string_from_resource.cc
deleted file mode 100644
index 0388899..0000000
--- a/remoting/host/setup/win/load_string_from_resource.cc
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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.
-
-#include "remoting/host/setup/win/load_string_from_resource.h"
-
-namespace remoting {
-
-CAtlString LoadStringFromResource(int id) {
- CAtlString s;
- if (!s.LoadString(id)) {
- s.Format(L"Missing resource %d", id);
- }
- return s;
-}
-
-} // namespace remoting
diff --git a/remoting/host/setup/win/load_string_from_resource.h b/remoting/host/setup/win/load_string_from_resource.h
deleted file mode 100644
index 24be1c7..0000000
--- a/remoting/host/setup/win/load_string_from_resource.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// 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_LOAD_STRING_FROM_RESOURCE_H_
-#define REMOTING_HOST_SETUP_WIN_LOAD_STRING_FROM_RESOURCE_H_
-
-#include <atlbase.h>
-#include <atlstr.h>
-#include <atlwin.h>
-
-namespace remoting {
-
-// Loads a string from a resource.
-CAtlString LoadStringFromResource(int id);
-
-} // namespace remoting
-
-#endif // REMOTING_HOST_SETUP_WIN_LOAD_STRING_FROM_RESOURCE_H_
diff --git a/remoting/host/setup/win/start_host_window.cc b/remoting/host/setup/win/start_host_window.cc
deleted file mode 100644
index 3712dae..0000000
--- a/remoting/host/setup/win/start_host_window.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// 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.
-
-#include "remoting/host/setup/win/start_host_window.h"
-
-#include <atlbase.h>
-#include <atlwin.h>
-#include <windows.h>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string16.h"
-#include "base/strings/utf_string_conversions.h"
-#include "google_apis/gaia/gaia_urls.h"
-#include "remoting/host/service_urls.h"
-#include "remoting/host/setup/oauth_helper.h"
-#include "remoting/host/setup/pin_validator.h"
-#include "remoting/host/setup/win/load_string_from_resource.h"
-
-namespace remoting {
-
-StartHostWindow::StartHostWindow(
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter)
- : host_starter_(remoting::HostStarter::Create(
- remoting::ServiceUrls::GetInstance()->directory_hosts_url(),
- url_request_context_getter)),
- consent_to_collect_data_(true),
- mem_mgr_(GetProcessHeap()),
- string_mgr_(&mem_mgr_),
- weak_ptr_factory_(this),
- weak_ptr_(weak_ptr_factory_.GetWeakPtr()) {
-}
-
-void StartHostWindow::OnCancel(UINT code, int id, HWND control) {
- EndDialog(IDCANCEL);
-}
-
-void StartHostWindow::OnClose() {
- EndDialog(IDCANCEL);
-}
-
-LRESULT StartHostWindow::OnInitDialog(HWND wparam, LPARAM lparam) {
- // Failure of any of these calls is acceptable.
- SetWindowText(LoadStringFromResource(IDS_TITLE));
- GetDlgItem(IDC_CONSENT).SetWindowText(LoadStringFromResource(IDS_CONSENT));
- CheckDlgButton(IDC_CONSENT, BST_CHECKED);
- return TRUE;
-}
-
-void StartHostWindow::OnConsent(UINT code, int id, HWND control) {
- bool checked = (IsDlgButtonChecked(IDC_CONSENT) == BST_CHECKED);
- checked = !checked;
- CheckDlgButton(IDC_CONSENT, checked ? BST_CHECKED : BST_UNCHECKED);
-}
-
-void StartHostWindow::OnOk(UINT code, int id, HWND control) {
- host_name_ = GetDlgItemString(IDC_HOST_NAME);
- pin_ = GetDlgItemString(IDC_PIN);
- std::string confirm_pin = GetDlgItemString(IDC_CONFIRM_PIN);
- consent_to_collect_data_ = (IsDlgButtonChecked(IDC_CONSENT) == BST_CHECKED);
- if (pin_ != confirm_pin) {
- MessageBox(LoadStringFromResource(IDS_SAME_PIN),
- LoadStringFromResource(IDS_TITLE),
- MB_ICONEXCLAMATION | MB_OK);
- return;
- }
- if (!IsPinValid(pin_)) {
- MessageBox(LoadStringFromResource(IDS_INVALID_PIN),
- LoadStringFromResource(IDS_TITLE), MB_ICONEXCLAMATION | MB_OK);
- return;
- }
- MessageBox(LoadStringFromResource(IDS_USE_BROWSER),
- LoadStringFromResource(IDS_TITLE), MB_OK);
- auth_code_getter_.GetAuthCode(
- base::Bind(&StartHostWindow::OnAuthCode, weak_ptr_));
-}
-
-void StartHostWindow::OnAuthCode(const std::string& auth_code) {
- if (auth_code.empty())
- return;
-
- host_starter_->StartHost(
- host_name_, pin_, consent_to_collect_data_, auth_code,
- GetDefaultOauthRedirectUrl(),
- base::Bind(&StartHostWindow::OnHostStarted, weak_ptr_));
-}
-
-void StartHostWindow::OnHostStarted(remoting::HostStarter::Result result) {
- if (result == remoting::HostStarter::START_COMPLETE) {
- MessageBox(LoadStringFromResource(IDS_HOST_START_SUCCEEDED),
- LoadStringFromResource(IDS_TITLE), MB_OK);
- EndDialog(IDOK);
- } else {
- MessageBox(LoadStringFromResource(IDS_HOST_START_FAILED),
- LoadStringFromResource(IDS_TITLE), MB_ICONEXCLAMATION | MB_OK);
- }
-}
-
-std::string StartHostWindow::GetDlgItemString(int id) {
- CSimpleString str(L"", &string_mgr_);
- GetDlgItemText(id, str);
- return UTF16ToUTF8(str.GetString());
-}
-
-} // namespace remoting
diff --git a/remoting/host/setup/win/start_host_window.h b/remoting/host/setup/win/start_host_window.h
deleted file mode 100644
index 3e267af..0000000
--- a/remoting/host/setup/win/start_host_window.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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 <atlstr.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/win/auth_code_getter.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(
- scoped_refptr<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.
- std::string host_name_;
- std::string pin_;
- bool consent_to_collect_data_;
-
- // A string manager that lets us use CSimpleString.
- CWin32Heap mem_mgr_;
- CAtlStringMgr string_mgr_;
-
- // WeakPtr used to avoid AuthCodeGetter or HostStarter callbacks accessing
- // this dialog box after it's closed.
- base::WeakPtrFactory<StartHostWindow> weak_ptr_factory_;
- base::WeakPtr<StartHostWindow> weak_ptr_;
-
- DISALLOW_COPY_AND_ASSIGN(StartHostWindow);
-};
-
-} // namespace remoting
-
-#endif // REMOTING_HOST_SETUP_WIN_START_HOST_WINDOW_H_
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index e2c49b1..f0f46c8 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -611,8 +611,6 @@
'host/setup/daemon_controller_delegate_win.h',
'host/setup/daemon_installer_win.cc',
'host/setup/daemon_installer_win.h',
- 'host/setup/host_starter.cc',
- 'host/setup/host_starter.h',
'host/setup/me2me_native_messaging_host.cc',
'host/setup/me2me_native_messaging_host.h',
'host/setup/oauth_client.cc',
@@ -755,7 +753,6 @@
'remoting_host_event_logger',
'remoting_host_logging',
'remoting_infoplist_strings',
- 'remoting_host_setup_base',
'remoting_jingle_glue',
'remoting_resources',
],
@@ -1133,6 +1130,8 @@
'remoting_host_setup_base',
],
'sources': [
+ 'host/setup/host_starter.cc',
+ 'host/setup/host_starter.h',
'host/setup/start_host.cc',
],
'conditions': [
@@ -1472,42 +1471,6 @@
},
],
}, # end of target 'remoting_lib_rc'
- {
- 'target_name': 'remoting_configurer',
- 'type': 'executable',
- 'defines': [
- '_ATL_NO_EXCEPTIONS',
- ],
- 'dependencies': [
- '../base/base.gyp:base',
- '../crypto/crypto.gyp:crypto',
- 'remoting_host',
- 'remoting_host_setup_base',
- ],
- 'sources': [
- 'host/branding.cc',
- 'host/setup/win/host_configurer.cc',
- 'host/setup/win/host_configurer.rc',
- 'host/setup/win/host_configurer_window.cc',
- 'host/setup/win/host_configurer_window.h',
- 'host/setup/win/host_configurer_resource.h',
- 'host/setup/win/load_string_from_resource.cc',
- 'host/setup/win/load_string_from_resource.h',
- 'host/setup/win/start_host_window.cc',
- 'host/setup/win/start_host_window.h',
- ],
- 'msvs_settings': {
- 'VCManifestTool': {
- 'AdditionalManifestFiles': [
- 'host/win/common-controls.manifest',
- ],
- },
- 'VCLinkerTool': {
- # 2 == /SUBSYSTEM:WINDOWS
- 'SubSystem': '2',
- },
- },
- }, # end of target 'remoting_configurer'
# The only difference between |remoting_console.exe| and
# |remoting_host.exe| is that the former is a console application.
# |remoting_console.exe| is used for debugging purposes.