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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 log_to_server_.reset( | 430 log_to_server_.reset( |
430 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); | 431 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); |
431 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 432 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); |
432 | 433 |
433 #if defined(OS_MACOSX) || defined(OS_WIN) | 434 #if defined(OS_MACOSX) || defined(OS_WIN) |
434 host_user_interface_->Start( | 435 host_user_interface_->Start( |
435 host_, base::Bind(&HostProcess::OnDisconnectRequested, | 436 host_, base::Bind(&HostProcess::OnDisconnectRequested, |
436 base::Unretained(this))); | 437 base::Unretained(this))); |
437 #endif | 438 #endif |
438 | 439 |
440 #if defined(OS_MACOSX) | |
Lambros
2012/08/08 00:48:29
Please could you add a comment explaining why we w
Jamie
2012/08/08 01:39:43
I've added it to the header file, which seemed a m
| |
441 curtain_.Init(base::Bind(&HostProcess::OnDisconnectRequested, | |
442 base::Unretained(this))); | |
443 host_->AddStatusObserver(&curtain_); | |
444 #endif | |
445 | |
439 host_->Start(); | 446 host_->Start(); |
440 | 447 |
441 CreateAuthenticatorFactory(); | 448 CreateAuthenticatorFactory(); |
442 } | 449 } |
443 | 450 |
444 void OnAuthFailed() { | 451 void OnAuthFailed() { |
445 Shutdown(kInvalidOauthCredentialsExitCode); | 452 Shutdown(kInvalidOauthCredentialsExitCode); |
446 } | 453 } |
447 | 454 |
448 // Invoked when the user uses the Disconnect windows to terminate | 455 // Invoked when the user uses the Disconnect windows to terminate |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 scoped_ptr<LogToServer> log_to_server_; | 548 scoped_ptr<LogToServer> log_to_server_; |
542 scoped_ptr<HostEventLogger> host_event_logger_; | 549 scoped_ptr<HostEventLogger> host_event_logger_; |
543 | 550 |
544 #if defined(OS_MACOSX) || defined(OS_WIN) | 551 #if defined(OS_MACOSX) || defined(OS_WIN) |
545 scoped_ptr<HostUserInterface> host_user_interface_; | 552 scoped_ptr<HostUserInterface> host_user_interface_; |
546 #endif | 553 #endif |
547 | 554 |
548 scoped_refptr<ChromotingHost> host_; | 555 scoped_refptr<ChromotingHost> host_; |
549 | 556 |
550 int exit_code_; | 557 int exit_code_; |
558 | |
559 #if defined(OS_MACOSX) | |
560 remoting::CurtainMode curtain_; | |
561 #endif | |
551 }; | 562 }; |
552 | 563 |
553 } // namespace remoting | 564 } // namespace remoting |
554 | 565 |
555 int main(int argc, char** argv) { | 566 int main(int argc, char** argv) { |
556 #if defined(OS_MACOSX) | 567 #if defined(OS_MACOSX) |
557 // Needed so we don't leak objects when threads are created. | 568 // Needed so we don't leak objects when threads are created. |
558 base::mac::ScopedNSAutoreleasePool pool; | 569 base::mac::ScopedNSAutoreleasePool pool; |
559 #endif | 570 #endif |
560 | 571 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 user32.GetFunctionPointer("SetProcessDPIAware")); | 648 user32.GetFunctionPointer("SetProcessDPIAware")); |
638 set_process_dpi_aware(); | 649 set_process_dpi_aware(); |
639 } | 650 } |
640 | 651 |
641 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 652 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
642 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 653 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
643 return main(0, NULL); | 654 return main(0, NULL); |
644 } | 655 } |
645 | 656 |
646 #endif // defined(OS_WIN) | 657 #endif // defined(OS_WIN) |
OLD | NEW |