| 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 #include "remoting/host/setup/me2me_native_messaging_host_main.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host_main.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "net/url_request/url_fetcher.h" | 15 #include "net/url_request/url_fetcher.h" |
| 16 #include "remoting/base/breakpad.h" | 16 #include "remoting/base/breakpad.h" |
| 17 #include "remoting/base/url_request_context_getter.h" | 17 #include "remoting/base/url_request_context_getter.h" |
| 18 #include "remoting/host/host_exit_codes.h" | 18 #include "remoting/host/host_exit_codes.h" |
| 19 #include "remoting/host/logging.h" | 19 #include "remoting/host/logging.h" |
| 20 #include "remoting/host/native_messaging/pipe_messaging_channel.h" | 20 #include "remoting/host/native_messaging/pipe_messaging_channel.h" |
| 21 #include "remoting/host/pairing_registry_delegate.h" | 21 #include "remoting/host/pairing_registry_delegate.h" |
| 22 #include "remoting/host/setup/gaia_oauth_client.h" |
| 22 #include "remoting/host/setup/me2me_native_messaging_host.h" | 23 #include "remoting/host/setup/me2me_native_messaging_host.h" |
| 23 #include "remoting/host/usage_stats_consent.h" | 24 #include "remoting/host/usage_stats_consent.h" |
| 24 | 25 |
| 25 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
| 26 #include "base/mac/scoped_nsautorelease_pool.h" | 27 #include "base/mac/scoped_nsautorelease_pool.h" |
| 27 #endif // defined(OS_MACOSX) | 28 #endif // defined(OS_MACOSX) |
| 28 | 29 |
| 29 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
| 30 #include "base/win/registry.h" | 31 #include "base/win/registry.h" |
| 31 #include "base/win/windows_version.h" | 32 #include "base/win/windows_version.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 write_file = base::File(STDOUT_FILENO); | 191 write_file = base::File(STDOUT_FILENO); |
| 191 #else | 192 #else |
| 192 #error Not implemented. | 193 #error Not implemented. |
| 193 #endif | 194 #endif |
| 194 | 195 |
| 195 // OAuth client (for credential requests). IO thread is used for blocking | 196 // OAuth client (for credential requests). IO thread is used for blocking |
| 196 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter( | 197 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter( |
| 197 new URLRequestContextGetter(io_thread.task_runner(), | 198 new URLRequestContextGetter(io_thread.task_runner(), |
| 198 file_thread.task_runner())); | 199 file_thread.task_runner())); |
| 199 scoped_ptr<OAuthClient> oauth_client( | 200 scoped_ptr<OAuthClient> oauth_client( |
| 200 new OAuthClient(url_request_context_getter)); | 201 new GaiaOAuthClient(url_request_context_getter)); |
| 201 | 202 |
| 202 net::URLFetcher::SetIgnoreCertificateRequests(true); | 203 net::URLFetcher::SetIgnoreCertificateRequests(true); |
| 203 | 204 |
| 204 // Create the pairing registry. | 205 // Create the pairing registry. |
| 205 scoped_refptr<PairingRegistry> pairing_registry; | 206 scoped_refptr<PairingRegistry> pairing_registry; |
| 206 | 207 |
| 207 #if defined(OS_WIN) | 208 #if defined(OS_WIN) |
| 208 base::win::RegKey root; | 209 base::win::RegKey root; |
| 209 LONG result = root.Open(HKEY_LOCAL_MACHINE, kPairingRegistryKeyName, | 210 LONG result = root.Open(HKEY_LOCAL_MACHINE, kPairingRegistryKeyName, |
| 210 KEY_READ); | 211 KEY_READ); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // This object instance is required by Chrome code (such as MessageLoop). | 275 // This object instance is required by Chrome code (such as MessageLoop). |
| 275 base::AtExitManager exit_manager; | 276 base::AtExitManager exit_manager; |
| 276 | 277 |
| 277 base::CommandLine::Init(argc, argv); | 278 base::CommandLine::Init(argc, argv); |
| 278 remoting::InitHostLogging(); | 279 remoting::InitHostLogging(); |
| 279 | 280 |
| 280 return StartMe2MeNativeMessagingHost(); | 281 return StartMe2MeNativeMessagingHost(); |
| 281 } | 282 } |
| 282 | 283 |
| 283 } // namespace remoting | 284 } // namespace remoting |
| OLD | NEW |