| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/media/android/router/media_router_android.h" | 5 #include "chrome/browser/media/android/router/media_router_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void MediaRouterAndroid::JoinRoute( | 91 void MediaRouterAndroid::JoinRoute( |
| 92 const MediaSource::Id& source, | 92 const MediaSource::Id& source, |
| 93 const std::string& presentation_id, | 93 const std::string& presentation_id, |
| 94 const GURL& origin, | 94 const GURL& origin, |
| 95 int tab_id, | 95 int tab_id, |
| 96 const std::vector<MediaRouteResponseCallback>& callbacks) { | 96 const std::vector<MediaRouteResponseCallback>& callbacks) { |
| 97 NOTIMPLEMENTED(); | 97 NOTIMPLEMENTED(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MediaRouterAndroid::CloseRoute(const MediaRoute::Id& route_id) { | 100 void MediaRouterAndroid::CloseRoute(const MediaRoute::Id& route_id) { |
| 101 NOTIMPLEMENTED(); | 101 JNIEnv* env = base::android::AttachCurrentThread(); |
| 102 ScopedJavaLocalRef<jstring> jroute_id = |
| 103 base::android::ConvertUTF8ToJavaString(env, route_id); |
| 104 Java_ChromeMediaRouter_closeRoute( |
| 105 env, java_media_router_.obj(), jroute_id.obj()); |
| 102 } | 106 } |
| 103 | 107 |
| 104 void MediaRouterAndroid::SendRouteMessage( | 108 void MediaRouterAndroid::SendRouteMessage( |
| 105 const MediaRoute::Id& route_id, | 109 const MediaRoute::Id& route_id, |
| 106 const std::string& message, | 110 const std::string& message, |
| 107 const SendRouteMessageCallback& callback) { | 111 const SendRouteMessageCallback& callback) { |
| 108 NOTIMPLEMENTED(); | 112 NOTIMPLEMENTED(); |
| 109 } | 113 } |
| 110 | 114 |
| 111 void MediaRouterAndroid::SendRouteBinaryMessage( | 115 void MediaRouterAndroid::SendRouteBinaryMessage( |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 257 |
| 254 std::string error_text = ConvertJavaStringToUTF8(env, jerror_text); | 258 std::string error_text = ConvertJavaStringToUTF8(env, jerror_text); |
| 255 | 259 |
| 256 for (const MediaRouteResponseCallback& callback : request->callbacks) | 260 for (const MediaRouteResponseCallback& callback : request->callbacks) |
| 257 callback.Run(nullptr, std::string(), error_text); | 261 callback.Run(nullptr, std::string(), error_text); |
| 258 | 262 |
| 259 create_route_requests_.Remove(jcreate_route_request_id); | 263 create_route_requests_.Remove(jcreate_route_request_id); |
| 260 } | 264 } |
| 261 | 265 |
| 262 } // namespace media_router | 266 } // namespace media_router |
| OLD | NEW |