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

Side by Side Diff: remoting/host/setup/win/host_configurer.cc

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include <windows.h>
6 #include <ole2.h>
7
8 #include "base/at_exit.h"
9 #include "base/command_line.h"
10 #include "base/run_loop.h"
11 #include "base/threading/thread.h"
12 #include "remoting/host/setup/win/host_configurer_window.h"
13 #include "remoting/host/url_request_context.h"
14
15 class HostConfigurerModule
16 : public ATL::CAtlExeModuleT<HostConfigurerModule> {
alexeypa (please no reviews) 2012/10/12 17:09:35 nit: Include atlbase.h & Co.
simonmorris 2012/10/15 16:51:42 Done.
17 };
18
19 HostConfigurerModule _AtlModule;
20
21 // An app that runs a HostConfigurerWindow.
22 int WINAPI WinMain(HINSTANCE instance_handle, HINSTANCE prev_instance_handle,
23 LPSTR cmd_line, int cmd)
24 {
25 // google_apis::GetOAuth2ClientID/Secret need the next line.
26 // On Windows, CommandLine::Init ignores its arguments, and parses
27 // GetCommandLineW directly, so we can pass it dummy arguments.
28 CommandLine::Init(0, NULL);
29
30 // Register and initialize common controls.
31 INITCOMMONCONTROLSEX info;
32 info.dwSize = sizeof(info);
33 info.dwICC = ICC_STANDARD_CLASSES;
34 InitCommonControlsEx(&info);
35
36 // This object instance is required by Chrome code (for example,
37 // FilePath, LazyInstance, MessageLoop).
38 base::AtExitManager exit_manager;
39
40 // Provide message loops and threads for the URLRequestContextGetter.
41 MessageLoop message_loop(MessageLoop::TYPE_UI);
42 base::Thread io_thread("IO thread");
43 base::Thread::Options io_thread_options(MessageLoop::TYPE_IO, 0);
44 io_thread.StartWithOptions(io_thread_options);
45
46 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_(
47 new remoting::URLRequestContextGetter(
48 message_loop.message_loop_proxy(), io_thread.message_loop_proxy()));
49
50 OleInitialize(NULL);
51
52 // Run a HostConfigurerWindow.
53 remoting::HostConfigurerWindow host_configurer_window(
54 url_request_context_getter_);
55 host_configurer_window.Create(NULL);
56
57 base::RunLoop run_loop;
58 run_loop.Run();
59
60 io_thread.Stop();
61
62 OleUninitialize();
63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698