| 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.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/json/json_reader.h" | 15 #include "base/json/json_reader.h" |
| 16 #include "base/json/json_writer.h" | 16 #include "base/json/json_writer.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/ptr_util.h" |
| 19 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
| 20 #include "base/strings/stringize_macros.h" | 21 #include "base/strings/stringize_macros.h" |
| 21 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 22 #include "base/values.h" | 23 #include "base/values.h" |
| 23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 24 #include "google_apis/gaia/gaia_oauth_client.h" | 25 #include "google_apis/gaia/gaia_oauth_client.h" |
| 25 #include "google_apis/google_api_keys.h" | 26 #include "google_apis/google_api_keys.h" |
| 26 #include "net/base/network_interfaces.h" | 27 #include "net/base/network_interfaces.h" |
| 27 #include "remoting/base/auto_thread_task_runner.h" | 28 #include "remoting/base/auto_thread_task_runner.h" |
| 28 #include "remoting/base/oauth_client.h" | 29 #include "remoting/base/oauth_client.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 451 } |
| 451 | 452 |
| 452 void Me2MeNativeMessagingHost::SendConfigResponse( | 453 void Me2MeNativeMessagingHost::SendConfigResponse( |
| 453 std::unique_ptr<base::DictionaryValue> response, | 454 std::unique_ptr<base::DictionaryValue> response, |
| 454 std::unique_ptr<base::DictionaryValue> config) { | 455 std::unique_ptr<base::DictionaryValue> config) { |
| 455 DCHECK(task_runner()->BelongsToCurrentThread()); | 456 DCHECK(task_runner()->BelongsToCurrentThread()); |
| 456 | 457 |
| 457 if (config) { | 458 if (config) { |
| 458 response->Set("config", config.release()); | 459 response->Set("config", config.release()); |
| 459 } else { | 460 } else { |
| 460 response->Set("config", base::Value::CreateNullValue()); | 461 response->Set("config", base::MakeUnique<base::Value>()); |
| 461 } | 462 } |
| 462 SendMessageToClient(std::move(response)); | 463 SendMessageToClient(std::move(response)); |
| 463 } | 464 } |
| 464 | 465 |
| 465 void Me2MeNativeMessagingHost::SendPairedClientsResponse( | 466 void Me2MeNativeMessagingHost::SendPairedClientsResponse( |
| 466 std::unique_ptr<base::DictionaryValue> response, | 467 std::unique_ptr<base::DictionaryValue> response, |
| 467 std::unique_ptr<base::ListValue> pairings) { | 468 std::unique_ptr<base::ListValue> pairings) { |
| 468 DCHECK(task_runner()->BelongsToCurrentThread()); | 469 DCHECK(task_runner()->BelongsToCurrentThread()); |
| 469 | 470 |
| 470 response->Set("pairedClients", pairings.release()); | 471 response->Set("pairedClients", pairings.release()); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 571 |
| 571 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( | 572 bool Me2MeNativeMessagingHost::DelegateToElevatedHost( |
| 572 std::unique_ptr<base::DictionaryValue> message) { | 573 std::unique_ptr<base::DictionaryValue> message) { |
| 573 NOTREACHED(); | 574 NOTREACHED(); |
| 574 return false; | 575 return false; |
| 575 } | 576 } |
| 576 | 577 |
| 577 #endif // !defined(OS_WIN) | 578 #endif // !defined(OS_WIN) |
| 578 | 579 |
| 579 } // namespace remoting | 580 } // namespace remoting |
| OLD | NEW |