OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_CLIENT_PLUGIN_CLIENT_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_CLIENT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/scoped_ptr.h" |
| 11 #include "remoting/client/plugin/chromoting_plugin.h" |
| 12 |
| 13 namespace remoting { |
| 14 |
| 15 class BinaryImage; |
| 16 class BinaryImageHeader; |
| 17 class HostConnection; |
| 18 |
| 19 class ChromotingClient { |
| 20 public: |
| 21 explicit ChromotingClient(ChromotingPlugin* plugin); |
| 22 virtual ~ChromotingClient(); |
| 23 |
| 24 void hexdump(void *ptr, int buflen); |
| 25 |
| 26 void merge_image(BinaryImageHeader* header, char* data); |
| 27 void draw(int width, int height, NPDeviceContext2D* context); |
| 28 |
| 29 bool connect_to_host(const std::string ip); |
| 30 void print_host_ip_prompt(); |
| 31 |
| 32 void set_window(); |
| 33 |
| 34 void handle_char_event(NPPepperEvent* npevent); |
| 35 void handle_login_char(char ch); |
| 36 |
| 37 void handle_mouse_event(NPPepperEvent* npevent); |
| 38 void send_mouse_message(NPPepperEvent* event); |
| 39 |
| 40 bool handle_update_message(); |
| 41 |
| 42 bool check_image_header(BinaryImageHeader* header); |
| 43 bool read_image(BinaryImage* image); |
| 44 |
| 45 private: |
| 46 // Pepper plugin (communicate with browser). |
| 47 ChromotingPlugin* plugin_; |
| 48 |
| 49 // Network connection (communicate with remote host machine). |
| 50 HostConnection* host_; |
| 51 |
| 52 // IP address of remote host machine. |
| 53 std::string host_ip_address_; |
| 54 |
| 55 // Screen bitmap image. |
| 56 scoped_ptr<BinaryImage> screen_; |
| 57 |
| 58 // Display extended output messages (for debugging). |
| 59 bool verbose_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(ChromotingClient); |
| 62 }; |
| 63 |
| 64 } // namespace remoting |
| 65 |
| 66 #endif // REMOTING_CLIENT_PLUGIN_CLIENT_H_ |
OLD | NEW |