| 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_dialog_controller_and
roid.h" | 5 #include "chrome/browser/media/android/router/media_router_dialog_controller_and
roid.h" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "chrome/browser/media/android/router/media_router_android.h" | 10 #include "chrome/browser/media/android/router/media_router_android.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 void MediaRouterDialogControllerAndroid::OnRouteClosed( | 62 void MediaRouterDialogControllerAndroid::OnRouteClosed( |
| 63 JNIEnv* env, | 63 JNIEnv* env, |
| 64 jobject obj, | 64 jobject obj, |
| 65 jstring jmedia_route_id) { | 65 jstring jmedia_route_id) { |
| 66 std::string media_route_id = ConvertJavaStringToUTF8(env, jmedia_route_id); | 66 std::string media_route_id = ConvertJavaStringToUTF8(env, jmedia_route_id); |
| 67 | 67 |
| 68 MediaRouter* router = MediaRouterFactory::GetApiForBrowserContext( | 68 MediaRouter* router = MediaRouterFactory::GetApiForBrowserContext( |
| 69 initiator()->GetBrowserContext()); | 69 initiator()->GetBrowserContext()); |
| 70 | 70 |
| 71 router->CloseRoute(media_route_id); | 71 router->TerminateRoute(media_route_id); |
| 72 | 72 |
| 73 CancelPresentationRequest(); | 73 CancelPresentationRequest(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void MediaRouterDialogControllerAndroid::OnDialogCancelled( | 76 void MediaRouterDialogControllerAndroid::OnDialogCancelled( |
| 77 JNIEnv* env, jobject obj) { | 77 JNIEnv* env, jobject obj) { |
| 78 CancelPresentationRequest(); | 78 CancelPresentationRequest(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void MediaRouterDialogControllerAndroid::CancelPresentationRequest() { | 81 void MediaRouterDialogControllerAndroid::CancelPresentationRequest() { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (single_existing_route_.get() && | 160 if (single_existing_route_.get() && |
| 161 single_existing_route_->media_route_id() == routes[0].media_route_id()) { | 161 single_existing_route_->media_route_id() == routes[0].media_route_id()) { |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 | 164 |
| 165 single_existing_route_.reset(new MediaRoute(routes[0])); | 165 single_existing_route_.reset(new MediaRoute(routes[0])); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace media_router | 168 } // namespace media_router |
| 169 | 169 |
| OLD | NEW |