OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file implements a simple X11 chromoting client. | 5 // This file implements a simple X11 chromoting client. |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 remoting::ClientContext context; | 34 remoting::ClientContext context; |
35 remoting::protocol::ConnectionToHost connection(context.jingle_thread(), | 35 remoting::protocol::ConnectionToHost connection(context.jingle_thread(), |
36 NULL, NULL, NULL); | 36 NULL, NULL, NULL); |
37 remoting::X11View view; | 37 remoting::X11View view; |
38 scoped_refptr<remoting::RectangleUpdateDecoder> rectangle_decoder = | 38 scoped_refptr<remoting::RectangleUpdateDecoder> rectangle_decoder = |
39 new remoting::RectangleUpdateDecoder(context.decode_message_loop(), | 39 new remoting::RectangleUpdateDecoder(context.decode_message_loop(), |
40 &view); | 40 &view); |
41 remoting::X11InputHandler input_handler(&context, &connection, &view); | 41 remoting::X11InputHandler input_handler(&context, &connection, &view); |
42 remoting::ChromotingClient client( | 42 remoting::ChromotingClient client( |
43 config, &context, &connection, &view, rectangle_decoder, &input_handler, | 43 config, &context, &connection, &view, rectangle_decoder, &input_handler, |
44 NewRunnableFunction(&ClientQuit, &ui_loop)); | 44 new ClientLogger(), NewRunnableFunction(&ClientQuit, &ui_loop)); |
45 | 45 |
46 // Run the client on a new MessageLoop until | 46 // Run the client on a new MessageLoop until |
47 context.Start(); | 47 context.Start(); |
48 client.Start(); | 48 client.Start(); |
49 ui_loop.Run(); | 49 ui_loop.Run(); |
50 | 50 |
51 client.Stop(); | 51 client.Stop(); |
52 context.Stop(); | 52 context.Stop(); |
53 | 53 |
54 return 0; | 54 return 0; |
55 } | 55 } |
OLD | NEW |