OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "remoting/host/policy_hack/policy_watcher.h" | 44 #include "remoting/host/policy_hack/policy_watcher.h" |
45 #include "remoting/host/session_manager_factory.h" | 45 #include "remoting/host/session_manager_factory.h" |
46 #include "remoting/host/signaling_connector.h" | 46 #include "remoting/host/signaling_connector.h" |
47 #include "remoting/host/usage_stats_consent.h" | 47 #include "remoting/host/usage_stats_consent.h" |
48 #include "remoting/host/video_frame_capturer.h" | 48 #include "remoting/host/video_frame_capturer.h" |
49 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 49 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
50 #include "remoting/protocol/me2me_host_authenticator_factory.h" | 50 #include "remoting/protocol/me2me_host_authenticator_factory.h" |
51 | 51 |
52 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
53 #include "base/mac/scoped_nsautorelease_pool.h" | 53 #include "base/mac/scoped_nsautorelease_pool.h" |
| 54 #include "remoting/host/curtain_mode_mac.h" |
54 #include "remoting/host/sighup_listener_mac.h" | 55 #include "remoting/host/sighup_listener_mac.h" |
55 #endif | 56 #endif |
56 // N.B. OS_WIN is defined by including src/base headers. | 57 // N.B. OS_WIN is defined by including src/base headers. |
57 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
58 #include <commctrl.h> | 59 #include <commctrl.h> |
59 #endif | 60 #endif |
60 #if defined(TOOLKIT_GTK) | 61 #if defined(TOOLKIT_GTK) |
61 #include "ui/gfx/gtk_util.h" | 62 #include "ui/gfx/gtk_util.h" |
62 #endif | 63 #endif |
63 | 64 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 log_to_server_.reset( | 440 log_to_server_.reset( |
440 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 441 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
441 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 442 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
442 | 443 |
443 #if defined(OS_MACOSX) || defined(OS_WIN) | 444 #if defined(OS_MACOSX) || defined(OS_WIN) |
444 host_user_interface_->Start( | 445 host_user_interface_->Start( |
445 host_, base::Bind(&HostProcess::OnDisconnectRequested, | 446 host_, base::Bind(&HostProcess::OnDisconnectRequested, |
446 base::Unretained(this))); | 447 base::Unretained(this))); |
447 #endif | 448 #endif |
448 | 449 |
| 450 #if defined(OS_MACOSX) |
| 451 curtain_.Init(base::Bind(&HostProcess::OnDisconnectRequested, |
| 452 base::Unretained(this))); |
| 453 host_->AddStatusObserver(&curtain_); |
| 454 #endif |
| 455 |
449 host_->Start(); | 456 host_->Start(); |
450 | 457 |
451 CreateAuthenticatorFactory(); | 458 CreateAuthenticatorFactory(); |
452 } | 459 } |
453 | 460 |
454 void OnAuthFailed() { | 461 void OnAuthFailed() { |
455 Shutdown(kInvalidOauthCredentialsExitCode); | 462 Shutdown(kInvalidOauthCredentialsExitCode); |
456 } | 463 } |
457 | 464 |
458 // Invoked when the user uses the Disconnect windows to terminate | 465 // Invoked when the user uses the Disconnect windows to terminate |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 scoped_ptr<LogToServer> log_to_server_; | 558 scoped_ptr<LogToServer> log_to_server_; |
552 scoped_ptr<HostEventLogger> host_event_logger_; | 559 scoped_ptr<HostEventLogger> host_event_logger_; |
553 | 560 |
554 #if defined(OS_MACOSX) || defined(OS_WIN) | 561 #if defined(OS_MACOSX) || defined(OS_WIN) |
555 scoped_ptr<HostUserInterface> host_user_interface_; | 562 scoped_ptr<HostUserInterface> host_user_interface_; |
556 #endif | 563 #endif |
557 | 564 |
558 scoped_refptr<ChromotingHost> host_; | 565 scoped_refptr<ChromotingHost> host_; |
559 | 566 |
560 int exit_code_; | 567 int exit_code_; |
| 568 |
| 569 #if defined(OS_MACOSX) |
| 570 remoting::CurtainMode curtain_; |
| 571 #endif |
561 }; | 572 }; |
562 | 573 |
563 } // namespace remoting | 574 } // namespace remoting |
564 | 575 |
565 int main(int argc, char** argv) { | 576 int main(int argc, char** argv) { |
566 #if defined(OS_MACOSX) | 577 #if defined(OS_MACOSX) |
567 // Needed so we don't leak objects when threads are created. | 578 // Needed so we don't leak objects when threads are created. |
568 base::mac::ScopedNSAutoreleasePool pool; | 579 base::mac::ScopedNSAutoreleasePool pool; |
569 #endif | 580 #endif |
570 | 581 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 user32.GetFunctionPointer("SetProcessDPIAware")); | 658 user32.GetFunctionPointer("SetProcessDPIAware")); |
648 set_process_dpi_aware(); | 659 set_process_dpi_aware(); |
649 } | 660 } |
650 | 661 |
651 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 662 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
652 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 663 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
653 return main(0, NULL); | 664 return main(0, NULL); |
654 } | 665 } |
655 | 666 |
656 #endif // defined(OS_WIN) | 667 #endif // defined(OS_WIN) |
OLD | NEW |