| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 5 #ifndef REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
| 6 #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 6 #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "extensions/browser/api/messaging/native_message_host.h" | 15 #include "extensions/browser/api/messaging/native_message_host.h" |
| 16 #include "remoting/host/it2me/it2me_host.h" | 16 #include "remoting/host/it2me/it2me_host.h" |
| 17 #include "remoting/signaling/delegating_signal_strategy.h" |
| 17 | 18 |
| 18 #if !defined(OS_CHROMEOS) | 19 #if !defined(OS_CHROMEOS) |
| 19 #include "remoting/host/native_messaging/log_message_handler.h" | 20 #include "remoting/host/native_messaging/log_message_handler.h" |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class DictionaryValue; | 24 class DictionaryValue; |
| 24 class Value; | 25 class Value; |
| 25 class SingleThreadTaskRunner; | 26 class SingleThreadTaskRunner; |
| 26 } // namespace base | 27 } // namespace base |
| 27 | 28 |
| 28 namespace remoting { | 29 namespace remoting { |
| 29 | 30 |
| 30 class ChromotingHostContext; | 31 class ChromotingHostContext; |
| 31 class DelegatingSignalStrategy; | |
| 32 class ElevatedNativeMessagingHost; | 32 class ElevatedNativeMessagingHost; |
| 33 class PolicyWatcher; | 33 class PolicyWatcher; |
| 34 | 34 |
| 35 // Implementation of the native messaging host process. | 35 // Implementation of the native messaging host process. |
| 36 class It2MeNativeMessagingHost : public It2MeHost::Observer, | 36 class It2MeNativeMessagingHost : public It2MeHost::Observer, |
| 37 public extensions::NativeMessageHost { | 37 public extensions::NativeMessageHost { |
| 38 public: | 38 public: |
| 39 It2MeNativeMessagingHost(bool needs_elevation, | 39 It2MeNativeMessagingHost(bool needs_elevation, |
| 40 policy::PolicyService* policy_service, | 40 policy::PolicyService* policy_service, |
| 41 std::unique_ptr<ChromotingHostContext> host_context, | 41 std::unique_ptr<ChromotingHostContext> host_context, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 bool needs_elevation_ = false; | 87 bool needs_elevation_ = false; |
| 88 | 88 |
| 89 #if defined(OS_WIN) | 89 #if defined(OS_WIN) |
| 90 // Controls the lifetime of the elevated native messaging host process. | 90 // Controls the lifetime of the elevated native messaging host process. |
| 91 // Note: 'elevated' in this instance means having the UiAccess privilege, not | 91 // Note: 'elevated' in this instance means having the UiAccess privilege, not |
| 92 // being run as a higher privilege user. | 92 // being run as a higher privilege user. |
| 93 std::unique_ptr<ElevatedNativeMessagingHost> elevated_host_; | 93 std::unique_ptr<ElevatedNativeMessagingHost> elevated_host_; |
| 94 #endif // defined(OS_WIN) | 94 #endif // defined(OS_WIN) |
| 95 | 95 |
| 96 Client* client_ = nullptr; | 96 Client* client_ = nullptr; |
| 97 DelegatingSignalStrategy* delegating_signal_strategy_ = nullptr; | 97 DelegatingSignalStrategy::IqCallback incoming_message_callback_; |
| 98 std::unique_ptr<ChromotingHostContext> host_context_; | 98 std::unique_ptr<ChromotingHostContext> host_context_; |
| 99 std::unique_ptr<It2MeHostFactory> factory_; | 99 std::unique_ptr<It2MeHostFactory> factory_; |
| 100 scoped_refptr<It2MeHost> it2me_host_; | 100 scoped_refptr<It2MeHost> it2me_host_; |
| 101 | 101 |
| 102 #if !defined(OS_CHROMEOS) | 102 #if !defined(OS_CHROMEOS) |
| 103 // Don't install a log message handler on ChromeOS because we run in the | 103 // Don't install a log message handler on ChromeOS because we run in the |
| 104 // browser process and don't want to intercept all its log messages. | 104 // browser process and don't want to intercept all its log messages. |
| 105 std::unique_ptr<LogMessageHandler> log_message_handler_; | 105 std::unique_ptr<LogMessageHandler> log_message_handler_; |
| 106 #endif | 106 #endif |
| 107 | 107 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 129 | 129 |
| 130 base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_; | 130 base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_; |
| 131 base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_; | 131 base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHost); | 133 DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHost); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace remoting | 136 } // namespace remoting |
| 137 | 137 |
| 138 #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 138 #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
| OLD | NEW |