diff options
Diffstat (limited to 'remoting/host')
-rw-r--r-- | remoting/host/host_main.cc | 10 | ||||
-rw-r--r-- | remoting/host/it2me/it2me_host.cc (renamed from remoting/host/it2me/it2me_impl.cc) | 71 | ||||
-rw-r--r-- | remoting/host/it2me/it2me_host.h (renamed from remoting/host/it2me/it2me_impl.h) | 22 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_channel.cc (renamed from remoting/host/setup/native_messaging_channel.cc) | 2 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_channel.h (renamed from remoting/host/setup/native_messaging_channel.h) | 12 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_reader.cc (renamed from remoting/host/setup/native_messaging_reader.cc) | 2 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_reader.h (renamed from remoting/host/setup/native_messaging_reader.h) | 6 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_reader_unittest.cc (renamed from remoting/host/setup/native_messaging_reader_unittest.cc) | 2 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_writer.cc (renamed from remoting/host/setup/native_messaging_writer.cc) | 2 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_writer.h (renamed from remoting/host/setup/native_messaging_writer.h) | 6 | ||||
-rw-r--r-- | remoting/host/native_messaging/native_messaging_writer_unittest.cc (renamed from remoting/host/setup/native_messaging_writer_unittest.cc) | 2 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 26 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.h | 16 | ||||
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_host.cc (renamed from remoting/host/setup/native_messaging_host.cc) | 2 | ||||
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_host.h (renamed from remoting/host/setup/native_messaging_host.h) | 8 | ||||
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_host_main.cc (renamed from remoting/host/setup/native_messaging_host_main.cc) | 2 | ||||
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_host_unittest.cc (renamed from remoting/host/setup/native_messaging_host_unittest.cc) | 4 | ||||
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_manifest.json (renamed from remoting/host/setup/native_messaging_manifest.json) | 2 |
18 files changed, 97 insertions, 100 deletions
diff --git a/remoting/host/host_main.cc b/remoting/host/host_main.cc index bf3dc17..512bc64 100644 --- a/remoting/host/host_main.cc +++ b/remoting/host/host_main.cc @@ -21,7 +21,7 @@ #include "remoting/base/resources.h" #include "remoting/host/host_exit_codes.h" #include "remoting/host/logging.h" -#include "remoting/host/setup/native_messaging_host.h" +#include "remoting/host/setup/me2me_native_messaging_host.h" #include "remoting/host/usage_stats_consent.h" #if defined(OS_MACOSX) @@ -155,7 +155,10 @@ int RdpDesktopSessionMain() { MainRoutineFn SelectMainRoutine(const std::string& process_type) { MainRoutineFn main_routine = NULL; - if (process_type == kProcessTypeDaemon) { + if (process_type == kProcessTypeHost) { + main_routine = &HostProcessMain; +#if defined(OS_WIN) + } else if (process_type == kProcessTypeDaemon) { main_routine = &DaemonProcessMain; } else if (process_type == kProcessTypeDesktop) { main_routine = &DesktopProcessMain; @@ -163,10 +166,9 @@ MainRoutineFn SelectMainRoutine(const std::string& process_type) { main_routine = &ElevatedControllerMain; } else if (process_type == kProcessTypeRdpDesktopSession) { main_routine = &RdpDesktopSessionMain; - } else if (process_type == kProcessTypeHost) { - main_routine = &HostProcessMain; } else if (process_type == kProcessTypeNativeMessagingHost) { main_routine = &NativeMessagingHostMain; +#endif // defined(OS_WIN) } return main_routine; diff --git a/remoting/host/it2me/it2me_impl.cc b/remoting/host/it2me/it2me_host.cc index 7b1b4c4..465ca27 100644 --- a/remoting/host/it2me/it2me_impl.cc +++ b/remoting/host/it2me/it2me_host.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/it2me/it2me_impl.h" +#include "remoting/host/it2me/it2me_host.h" #include "base/bind.h" #include "base/strings/string_util.h" @@ -32,10 +32,10 @@ const int kMaxLoginAttempts = 5; } // namespace -It2MeImpl::It2MeImpl( +It2MeHost::It2MeHost( scoped_ptr<ChromotingHostContext> host_context, scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner, - base::WeakPtr<It2MeImpl::Observer> observer, + base::WeakPtr<It2MeHost::Observer> observer, const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, const std::string& directory_bot_jid) : host_context_(host_context.Pass()), @@ -50,11 +50,11 @@ It2MeImpl::It2MeImpl( DCHECK(plugin_task_runner_->BelongsToCurrentThread()); } -void It2MeImpl::Connect() { +void It2MeHost::Connect() { if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); host_context_->ui_task_runner()->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::Connect, this)); + FROM_HERE, base::Bind(&It2MeHost::Connect, this)); return; } @@ -67,18 +67,18 @@ void It2MeImpl::Connect() { policy_watcher_.reset( policy_hack::PolicyWatcher::Create(host_context_->network_task_runner())); policy_watcher_->StartWatching( - base::Bind(&It2MeImpl::OnPolicyUpdate, this)); + base::Bind(&It2MeHost::OnPolicyUpdate, this)); // Switch to the network thread to start the actual connection. host_context_->network_task_runner()->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::ReadPolicyAndConnect, this)); + FROM_HERE, base::Bind(&It2MeHost::ReadPolicyAndConnect, this)); } -void It2MeImpl::Disconnect() { +void It2MeHost::Disconnect() { if (!host_context_->network_task_runner()->BelongsToCurrentThread()) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); host_context_->network_task_runner()->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::Disconnect, this)); + FROM_HERE, base::Bind(&It2MeHost::Disconnect, this)); return; } @@ -109,16 +109,16 @@ void It2MeImpl::Disconnect() { // SignalStrategy::Listener handlers are not allowed to destroy // SignalStrategy, so post task to destroy the host later. host_context_->network_task_runner()->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::ShutdownOnNetworkThread, this)); + FROM_HERE, base::Bind(&It2MeHost::ShutdownOnNetworkThread, this)); return; } } -void It2MeImpl::RequestNatPolicy() { +void It2MeHost::RequestNatPolicy() { if (!host_context_->network_task_runner()->BelongsToCurrentThread()) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); host_context_->network_task_runner()->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::RequestNatPolicy, this)); + FROM_HERE, base::Bind(&It2MeHost::RequestNatPolicy, this)); return; } @@ -126,7 +126,7 @@ void It2MeImpl::RequestNatPolicy() { UpdateNatPolicy(nat_traversal_enabled_); } -void It2MeImpl::ReadPolicyAndConnect() { +void It2MeHost::ReadPolicyAndConnect() { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); SetState(kStarting); @@ -138,11 +138,11 @@ void It2MeImpl::ReadPolicyAndConnect() { } else { // Otherwise, create the policy watcher, and thunk the connect. pending_connect_ = - base::Bind(&It2MeImpl::FinishConnect, this); + base::Bind(&It2MeHost::FinishConnect, this); } } -void It2MeImpl::FinishConnect() { +void It2MeHost::FinishConnect() { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); if (state_ != kStarting) { @@ -172,7 +172,7 @@ void It2MeImpl::FinishConnect() { scoped_ptr<RegisterSupportHostRequest> register_request( new RegisterSupportHostRequest( signal_strategy.get(), host_key_pair_, directory_bot_jid_, - base::Bind(&It2MeImpl::OnReceivedSupportID, + base::Bind(&It2MeHost::OnReceivedSupportID, base::Unretained(this)))); // Beyond this point nothing can fail, so save the config and request. @@ -231,7 +231,7 @@ void It2MeImpl::FinishConnect() { return; } -void It2MeImpl::ShutdownOnNetworkThread() { +void It2MeHost::ShutdownOnNetworkThread() { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); DCHECK(state_ == kDisconnecting || state_ == kDisconnected); @@ -247,10 +247,10 @@ void It2MeImpl::ShutdownOnNetworkThread() { } host_context_->ui_task_runner()->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::ShutdownOnUiThread, this)); + FROM_HERE, base::Bind(&It2MeHost::ShutdownOnUiThread, this)); } -void It2MeImpl::ShutdownOnUiThread() { +void It2MeHost::ShutdownOnUiThread() { DCHECK(host_context_->ui_task_runner()->BelongsToCurrentThread()); // Destroy the DesktopEnvironmentFactory, to free thread references. @@ -265,7 +265,7 @@ void It2MeImpl::ShutdownOnUiThread() { } } -void It2MeImpl::OnAccessDenied(const std::string& jid) { +void It2MeHost::OnAccessDenied(const std::string& jid) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); ++failed_login_attempts_; @@ -274,8 +274,7 @@ void It2MeImpl::OnAccessDenied(const std::string& jid) { } } -void It2MeImpl::OnClientAuthenticated( - const std::string& jid) { +void It2MeHost::OnClientAuthenticated(const std::string& jid) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); if (state_ == kDisconnecting) { @@ -300,21 +299,19 @@ void It2MeImpl::OnClientAuthenticated( // Pass the client user name to the script object before changing state. plugin_task_runner_->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::Observer::OnClientAuthenticated, + FROM_HERE, base::Bind(&It2MeHost::Observer::OnClientAuthenticated, observer_, client_username)); SetState(kConnected); } -void It2MeImpl::OnClientDisconnected( - const std::string& jid) { +void It2MeHost::OnClientDisconnected(const std::string& jid) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); Disconnect(); } -void It2MeImpl::OnPolicyUpdate( - scoped_ptr<base::DictionaryValue> policies) { +void It2MeHost::OnPolicyUpdate(scoped_ptr<base::DictionaryValue> policies) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); bool nat_policy; @@ -336,8 +333,7 @@ void It2MeImpl::OnPolicyUpdate( } } -void It2MeImpl::UpdateNatPolicy( - bool nat_traversal_enabled) { +void It2MeHost::UpdateNatPolicy(bool nat_traversal_enabled) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); VLOG(2) << "UpdateNatPolicy: " << nat_traversal_enabled; @@ -352,12 +348,11 @@ void It2MeImpl::UpdateNatPolicy( // Notify the web-app of the policy setting. plugin_task_runner_->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::Observer::OnNatPolicyChanged, + FROM_HERE, base::Bind(&It2MeHost::Observer::OnNatPolicyChanged, observer_, nat_traversal_enabled_)); } -void It2MeImpl::UpdateHostDomainPolicy( - const std::string& host_domain) { +void It2MeHost::UpdateHostDomainPolicy(const std::string& host_domain) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); VLOG(2) << "UpdateHostDomainPolicy: " << host_domain; @@ -370,13 +365,13 @@ void It2MeImpl::UpdateHostDomainPolicy( required_host_domain_ = host_domain; } -It2MeImpl::~It2MeImpl() { +It2MeHost::~It2MeHost() { // Check that resources that need to be torn down on the UI thread are gone. DCHECK(!desktop_environment_factory_.get()); DCHECK(!policy_watcher_.get()); } -void It2MeImpl::SetState(It2MeHostState state) { +void It2MeHost::SetState(It2MeHostState state) { DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); switch (state_) { @@ -420,16 +415,16 @@ void It2MeImpl::SetState(It2MeHostState state) { // Post a state-change notification to the web-app. plugin_task_runner_->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::Observer::OnStateChanged, + FROM_HERE, base::Bind(&It2MeHost::Observer::OnStateChanged, observer_, state)); } -bool It2MeImpl::IsConnected() const { +bool It2MeHost::IsConnected() const { return state_ == kRequestedAccessCode || state_ == kReceivedAccessCode || state_ == kConnected; } -void It2MeImpl::OnReceivedSupportID( +void It2MeHost::OnReceivedSupportID( bool success, const std::string& support_id, const base::TimeDelta& lifetime) { @@ -459,7 +454,7 @@ void It2MeImpl::OnReceivedSupportID( // Pass the Access Code to the script object before changing state. plugin_task_runner_->PostTask( - FROM_HERE, base::Bind(&It2MeImpl::Observer::OnStoreAccessCode, + FROM_HERE, base::Bind(&It2MeHost::Observer::OnStoreAccessCode, observer_, access_code, lifetime)); SetState(kReceivedAccessCode); diff --git a/remoting/host/it2me/it2me_impl.h b/remoting/host/it2me/it2me_host.h index f31709b..6a40276 100644 --- a/remoting/host/it2me/it2me_impl.h +++ b/remoting/host/it2me/it2me_host.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef REMOTING_HOST_IT2ME__IT2ME_IMPL_H_ -#define REMOTING_HOST_IT2ME__IT2ME_IMPL_H_ +#ifndef REMOTING_HOST_IT2ME_IT2ME_HOST_H_ +#define REMOTING_HOST_IT2ME_IT2ME_HOST_H_ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -40,8 +40,8 @@ enum It2MeHostState { }; // Internal implementation of the plugin's It2Me host function. -class It2MeImpl - : public base::RefCountedThreadSafe<It2MeImpl>, +class It2MeHost + : public base::RefCountedThreadSafe<It2MeHost>, public HostStatusObserver { public: @@ -54,10 +54,10 @@ class It2MeImpl virtual void OnStateChanged(It2MeHostState state) = 0; }; - It2MeImpl( + It2MeHost( scoped_ptr<ChromotingHostContext> context, scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner, - base::WeakPtr<It2MeImpl::Observer> observer, + base::WeakPtr<It2MeHost::Observer> observer, const XmppSignalStrategy::XmppServerConfig& xmpp_server_config, const std::string& directory_bot_jid); @@ -79,9 +79,9 @@ class It2MeImpl virtual void OnClientDisconnected(const std::string& jid) OVERRIDE; private: - friend class base::RefCountedThreadSafe<It2MeImpl>; + friend class base::RefCountedThreadSafe<It2MeHost>; - virtual ~It2MeImpl(); + virtual ~It2MeHost(); // Updates state of the host. Can be called only on the network thread. void SetState(It2MeHostState state); @@ -118,7 +118,7 @@ class It2MeImpl // Caller supplied fields. scoped_ptr<ChromotingHostContext> host_context_; scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner_; - base::WeakPtr<It2MeImpl::Observer> observer_; + base::WeakPtr<It2MeHost::Observer> observer_; XmppSignalStrategy::XmppServerConfig xmpp_server_config_; std::string directory_bot_jid_; @@ -153,9 +153,9 @@ class It2MeImpl // variable contains the thunk if it is necessary. base::Closure pending_connect_; - DISALLOW_COPY_AND_ASSIGN(It2MeImpl); + DISALLOW_COPY_AND_ASSIGN(It2MeHost); }; } // namespace remoting -#endif // REMOTING_HOST_IT2ME__IT2ME_IMPL_H_ +#endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_ diff --git a/remoting/host/setup/native_messaging_channel.cc b/remoting/host/native_messaging/native_messaging_channel.cc index b93fd94..3d4cf60 100644 --- a/remoting/host/setup/native_messaging_channel.cc +++ b/remoting/host/native_messaging/native_messaging_channel.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_channel.h" +#include "remoting/host/native_messaging/native_messaging_channel.h" #include "base/basictypes.h" #include "base/bind.h" diff --git a/remoting/host/setup/native_messaging_channel.h b/remoting/host/native_messaging/native_messaging_channel.h index 9b0c229..f597847 100644 --- a/remoting/host/setup/native_messaging_channel.h +++ b/remoting/host/native_messaging/native_messaging_channel.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_CHANNEL_H_ -#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_CHANNEL_H_ +#ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_ +#define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_ #include "base/callback.h" #include "base/memory/ref_counted.h" @@ -11,8 +11,8 @@ #include "base/memory/weak_ptr.h" #include "base/platform_file.h" #include "base/threading/non_thread_safe.h" -#include "remoting/host/setup/native_messaging_reader.h" -#include "remoting/host/setup/native_messaging_writer.h" +#include "remoting/host/native_messaging/native_messaging_reader.h" +#include "remoting/host/native_messaging/native_messaging_writer.h" namespace base { class DictionaryValue; @@ -45,7 +45,7 @@ class NativeMessagingChannel : public base::NonThreadSafe { }; // Constructs an object taking the ownership of |input| and |output|. Closes - // |input| and |output| to prevent the caller frmo using them. + // |input| and |output| to prevent the caller from using them. NativeMessagingChannel( scoped_ptr<Delegate> delegate, base::PlatformFile input, @@ -91,4 +91,4 @@ class NativeMessagingChannel : public base::NonThreadSafe { } // namespace remoting -#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_CHANNEL_H_ +#endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_ diff --git a/remoting/host/setup/native_messaging_reader.cc b/remoting/host/native_messaging/native_messaging_reader.cc index 7151653..031daf7 100644 --- a/remoting/host/setup/native_messaging_reader.cc +++ b/remoting/host/native_messaging/native_messaging_reader.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_reader.h" +#include "remoting/host/native_messaging/native_messaging_reader.h" #include <string> diff --git a/remoting/host/setup/native_messaging_reader.h b/remoting/host/native_messaging/native_messaging_reader.h index b9c81c3..06eb4cc 100644 --- a/remoting/host/setup/native_messaging_reader.h +++ b/remoting/host/native_messaging/native_messaging_reader.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_READER_H_ -#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_READER_H_ +#ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_READER_H_ +#define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_READER_H_ #include "base/basictypes.h" #include "base/callback.h" @@ -73,4 +73,4 @@ class NativeMessagingReader { } // namespace remoting -#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_READER_H_ +#endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_READER_H_ diff --git a/remoting/host/setup/native_messaging_reader_unittest.cc b/remoting/host/native_messaging/native_messaging_reader_unittest.cc index c78b4c2..26ed78d 100644 --- a/remoting/host/setup/native_messaging_reader_unittest.cc +++ b/remoting/host/native_messaging/native_messaging_reader_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_reader.h" +#include "remoting/host/native_messaging/native_messaging_reader.h" #include "base/basictypes.h" #include "base/bind.h" diff --git a/remoting/host/setup/native_messaging_writer.cc b/remoting/host/native_messaging/native_messaging_writer.cc index 15d6cd7..9788f21 100644 --- a/remoting/host/setup/native_messaging_writer.cc +++ b/remoting/host/native_messaging/native_messaging_writer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_writer.h" +#include "remoting/host/native_messaging/native_messaging_writer.h" #include <string> diff --git a/remoting/host/setup/native_messaging_writer.h b/remoting/host/native_messaging/native_messaging_writer.h index 72e5345..6208f91 100644 --- a/remoting/host/setup/native_messaging_writer.h +++ b/remoting/host/native_messaging/native_messaging_writer.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_WRITER_H_ -#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_WRITER_H_ +#ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_ +#define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_ #include "base/platform_file.h" #include "net/base/file_stream.h" @@ -34,4 +34,4 @@ class NativeMessagingWriter { } // namespace remoting -#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_WRITER_H_ +#endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_ diff --git a/remoting/host/setup/native_messaging_writer_unittest.cc b/remoting/host/native_messaging/native_messaging_writer_unittest.cc index c0cfbd1..52bdb1f 100644 --- a/remoting/host/setup/native_messaging_writer_unittest.cc +++ b/remoting/host/native_messaging/native_messaging_writer_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_writer.h" +#include "remoting/host/native_messaging/native_messaging_writer.h" #include "base/basictypes.h" #include "base/json/json_reader.h" diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 66d228c..542f725 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -130,9 +130,9 @@ HostNPScriptObject::~HostNPScriptObject() { HostLogHandler::UnregisterLoggingScriptObject(this); // Stop the It2Me host if the caller forgot to. - if (it2me_impl_.get()) { - it2me_impl_->Disconnect(); - it2me_impl_ = NULL; + if (it2me_host_.get()) { + it2me_host_->Disconnect(); + it2me_host_ = NULL; } } @@ -315,9 +315,9 @@ bool HostNPScriptObject::SetProperty(const std::string& property_name, if (property_name == kAttrNameOnNatTraversalPolicyChanged) { if (NPVARIANT_IS_OBJECT(*value)) { on_nat_traversal_policy_changed_func_ = NPVARIANT_TO_OBJECT(*value); - if (it2me_impl_.get()) { - // Ask the It2Me implementation to notify the web-app of the policy. - it2me_impl_->RequestNatPolicy(); + if (it2me_host_.get()) { + // Ask the It2Me host to notify the web-app of the policy. + it2me_host_->RequestNatPolicy(); } return true; } else { @@ -454,7 +454,7 @@ bool HostNPScriptObject::Connect(const NPVariant* args, return false; } - if (it2me_impl_.get()) { + if (it2me_host_.get()) { SetException("connect: can be called only when disconnected"); return false; } @@ -483,11 +483,11 @@ bool HostNPScriptObject::Connect(const NPVariant* args, return false; } - // Create the It2Me host implementation and start connecting. - it2me_impl_ = new It2MeImpl( + // Create the It2Me host and start connecting. + it2me_host_ = new It2MeHost( host_context.Pass(), plugin_task_runner_, weak_ptr_, xmpp_config, directory_bot_jid_); - it2me_impl_->Connect(); + it2me_host_->Connect(); return true; } @@ -501,9 +501,9 @@ bool HostNPScriptObject::Disconnect(const NPVariant* args, return false; } - if (it2me_impl_.get()) { - it2me_impl_->Disconnect(); - it2me_impl_ = NULL; + if (it2me_host_.get()) { + it2me_host_->Disconnect(); + it2me_host_ = NULL; } return true; diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h index 74abcd9..2558903 100644 --- a/remoting/host/plugin/host_script_object.h +++ b/remoting/host/plugin/host_script_object.h @@ -13,7 +13,7 @@ #include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "remoting/base/auto_thread_task_runner.h" -#include "remoting/host/it2me/it2me_impl.h" +#include "remoting/host/it2me/it2me_host.h" #include "remoting/host/plugin/host_plugin_utils.h" #include "remoting/host/setup/daemon_controller.h" #include "remoting/jingle_glue/xmpp_signal_strategy.h" @@ -25,7 +25,7 @@ namespace remoting { // HostNPScriptObject creates threads that are required to run // ChromotingHost and starts/stops the host on those threads. When // destroyed it synchronously shuts down the host and all threads. -class HostNPScriptObject : public It2MeImpl::Observer { +class HostNPScriptObject : public It2MeHost::Observer { public: HostNPScriptObject(NPP plugin, NPObject* parent, @@ -157,7 +157,7 @@ class HostNPScriptObject : public It2MeImpl::Observer { bool StopDaemon(const NPVariant* args, uint32_t arg_count, NPVariant* result); ////////////////////////////////////////////////////////// - // Implementation of It2MeImpl::Observer methods. + // Implementation of It2MeHost::Observer methods. // Notifies OnStateChanged handler of a state change. virtual void OnStateChanged(It2MeHostState state) OVERRIDE; @@ -266,21 +266,21 @@ class HostNPScriptObject : public It2MeImpl::Observer { // It2Me host state. // Internal implementation of the It2Me host function. - scoped_refptr<It2MeImpl> it2me_impl_; + scoped_refptr<It2MeHost> it2me_host_; - // Cached, read-only copies of |it2me_impl_| session state. + // Cached, read-only copies of |it2me_host_| session state. It2MeHostState state_; std::string access_code_; base::TimeDelta access_code_lifetime_; std::string client_username_; - // IT2Me Talk server configuration used by |it2me_impl_| to connect. + // IT2Me Talk server configuration used by |it2me_host_| to connect. XmppSignalStrategy::XmppServerConfig xmpp_server_config_; - // Chromoting Bot JID used by |it2me_impl_| to register the host. + // Chromoting Bot JID used by |it2me_host_| to register the host. std::string directory_bot_jid_; - // Callbacks to notify in response to |it2me_impl_| events. + // Callbacks to notify in response to |it2me_host_| events. ScopedRefNPObject on_nat_traversal_policy_changed_func_; ScopedRefNPObject on_state_changed_func_; diff --git a/remoting/host/setup/native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index 38ecdb1..63297a9 100644 --- a/remoting/host/setup/native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_host.h" +#include "remoting/host/setup/me2me_native_messaging_host.h" #include <string> diff --git a/remoting/host/setup/native_messaging_host.h b/remoting/host/setup/me2me_native_messaging_host.h index 4a359d7..179b0fe 100644 --- a/remoting/host/setup/native_messaging_host.h +++ b/remoting/host/setup/me2me_native_messaging_host.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ -#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ +#ifndef REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ +#define REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" +#include "remoting/host/native_messaging/native_messaging_channel.h" #include "remoting/host/setup/daemon_controller.h" -#include "remoting/host/setup/native_messaging_channel.h" #include "remoting/host/setup/oauth_client.h" namespace base { @@ -155,4 +155,4 @@ int NativeMessagingHostMain(); } // namespace remoting -#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_ +#endif // REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ diff --git a/remoting/host/setup/native_messaging_host_main.cc b/remoting/host/setup/me2me_native_messaging_host_main.cc index d9db325..e69abfc 100644 --- a/remoting/host/setup/native_messaging_host_main.cc +++ b/remoting/host/setup/me2me_native_messaging_host_main.cc @@ -5,7 +5,7 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "remoting/host/logging.h" -#include "remoting/host/setup/native_messaging_host.h" +#include "remoting/host/setup/me2me_native_messaging_host.h" int main(int argc, char** argv) { // This object instance is required by Chrome code (such as MessageLoop). diff --git a/remoting/host/setup/native_messaging_host_unittest.cc b/remoting/host/setup/me2me_native_messaging_host_unittest.cc index 164b77d..0d6e700 100644 --- a/remoting/host/setup/native_messaging_host_unittest.cc +++ b/remoting/host/setup/me2me_native_messaging_host_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/host/setup/native_messaging_host.h" +#include "remoting/host/setup/me2me_native_messaging_host.h" #include "base/basictypes.h" #include "base/compiler_specific.h" @@ -17,8 +17,8 @@ #include "net/base/file_stream.h" #include "net/base/net_util.h" #include "remoting/base/auto_thread_task_runner.h" +#include "remoting/host/native_messaging/native_messaging_channel.h" #include "remoting/host/pin_hash.h" -#include "remoting/host/setup/native_messaging_channel.h" #include "remoting/host/setup/test_util.h" #include "remoting/protocol/pairing_registry.h" #include "remoting/protocol/protocol_mock_objects.h" diff --git a/remoting/host/setup/native_messaging_manifest.json b/remoting/host/setup/me2me_native_messaging_manifest.json index 84884a2..d0b2fb1 100644 --- a/remoting/host/setup/native_messaging_manifest.json +++ b/remoting/host/setup/me2me_native_messaging_manifest.json @@ -2,7 +2,7 @@ "name": "com.google.chrome.remote_desktop", "description": "{% trans %}REMOTING_HOST_PLUGIN_NAME{% endtrans %}", "type": "stdio", - "path": "{{ NATIVE_MESSAGING_HOST_PATH }}", + "path": "{{ ME2ME_NATIVE_MESSAGING_HOST_PATH }}", "allowed_origins": [ "chrome-extension://ljacajndfccfgnfohlgkdphmbnpkjflk/", "chrome-extension://gbchcmhmhahfdphkhkmpfmihenigjmpp/", |