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/client/jni/chromoting_jni_instance.h" | 5 #include "remoting/client/jni/chromoting_jni_instance.h" |
6 | 6 |
7 #include <android/log.h> | 7 #include <android/log.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "jingle/glue/thread_wrapper.h" | 11 #include "jingle/glue/thread_wrapper.h" |
12 #include "net/socket/client_socket_factory.h" | 12 #include "net/socket/client_socket_factory.h" |
13 #include "remoting/client/audio_player.h" | 13 #include "remoting/client/audio_player.h" |
14 #include "remoting/client/jni/android_keymap.h" | 14 #include "remoting/client/jni/android_keymap.h" |
15 #include "remoting/client/jni/chromoting_jni_runtime.h" | 15 #include "remoting/client/jni/chromoting_jni_runtime.h" |
16 #include "remoting/client/log_to_server.h" | 16 #include "remoting/client/log_to_server.h" |
17 #include "remoting/client/software_video_renderer.h" | 17 #include "remoting/client/software_video_renderer.h" |
| 18 #include "remoting/client/token_fetcher_proxy.h" |
18 #include "remoting/jingle_glue/chromium_port_allocator.h" | 19 #include "remoting/jingle_glue/chromium_port_allocator.h" |
19 #include "remoting/jingle_glue/chromium_socket_factory.h" | 20 #include "remoting/jingle_glue/chromium_socket_factory.h" |
20 #include "remoting/jingle_glue/network_settings.h" | 21 #include "remoting/jingle_glue/network_settings.h" |
21 #include "remoting/jingle_glue/server_log_entry.h" | 22 #include "remoting/jingle_glue/server_log_entry.h" |
22 #include "remoting/protocol/host_stub.h" | 23 #include "remoting/protocol/host_stub.h" |
23 #include "remoting/protocol/libjingle_transport_factory.h" | 24 #include "remoting/protocol/libjingle_transport_factory.h" |
24 | 25 |
25 namespace remoting { | 26 namespace remoting { |
26 | 27 |
27 namespace { | 28 namespace { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 99 |
99 // The weak pointers must be invalidated on the same thread they were used. | 100 // The weak pointers must be invalidated on the same thread they were used. |
100 view_weak_factory_->InvalidateWeakPtrs(); | 101 view_weak_factory_->InvalidateWeakPtrs(); |
101 | 102 |
102 jni_runtime_->network_task_runner()->PostTask( | 103 jni_runtime_->network_task_runner()->PostTask( |
103 FROM_HERE, | 104 FROM_HERE, |
104 base::Bind(&ChromotingJniInstance::DisconnectFromHostOnNetworkThread, | 105 base::Bind(&ChromotingJniInstance::DisconnectFromHostOnNetworkThread, |
105 this)); | 106 this)); |
106 } | 107 } |
107 | 108 |
| 109 void ChromotingJniInstance::FetchThirdPartyToken( |
| 110 const GURL& token_url, |
| 111 const std::string& client_id, |
| 112 const std::string& scope, |
| 113 base::WeakPtr<TokenFetcherProxy> jni_token_fetcher) { |
| 114 // TODO(kelvinp) Calls into the jni_runtime_ to obtain a token from the |
| 115 // android app (Android Third Party Auth - Part II). |
| 116 } |
| 117 |
108 void ChromotingJniInstance::ProvideSecret(const std::string& pin, | 118 void ChromotingJniInstance::ProvideSecret(const std::string& pin, |
109 bool create_pairing, | 119 bool create_pairing, |
110 const std::string& device_name) { | 120 const std::string& device_name) { |
111 DCHECK(jni_runtime_->ui_task_runner()->BelongsToCurrentThread()); | 121 DCHECK(jni_runtime_->ui_task_runner()->BelongsToCurrentThread()); |
112 DCHECK(!pin_callback_.is_null()); | 122 DCHECK(!pin_callback_.is_null()); |
113 | 123 |
114 create_pairing_ = create_pairing; | 124 create_pairing_ = create_pairing; |
115 | 125 |
116 if (create_pairing) | 126 if (create_pairing) |
117 SetDeviceName(device_name); | 127 SetDeviceName(device_name); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 stats->round_trip_ms()->Average()); | 443 stats->round_trip_ms()->Average()); |
434 | 444 |
435 log_to_server_->LogStatistics(stats); | 445 log_to_server_->LogStatistics(stats); |
436 | 446 |
437 jni_runtime_->network_task_runner()->PostDelayedTask( | 447 jni_runtime_->network_task_runner()->PostDelayedTask( |
438 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 448 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
439 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 449 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
440 } | 450 } |
441 | 451 |
442 } // namespace remoting | 452 } // namespace remoting |
OLD | NEW |