Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1825)

Unified Diff: chrome/browser/media/android/router/media_router_android.cc

Issue 1883423002: [Android,MediaRouter,Cast] implement onterminate and onclose. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable more disabled tests Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/android/router/media_router_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/android/router/media_router_android.cc
diff --git a/chrome/browser/media/android/router/media_router_android.cc b/chrome/browser/media/android/router/media_router_android.cc
index 76face5d047e7940948163b67a06d6574684ab01..de0afce9092722383ab718e2e243e264948df329 100644
--- a/chrome/browser/media/android/router/media_router_android.cc
+++ b/chrome/browser/media/android/router/media_router_android.cc
@@ -439,6 +439,23 @@ void MediaRouterAndroid::OnRouteClosed(
FOR_EACH_OBSERVER(MediaRoutesObserver, routes_observers_,
OnRoutesUpdated(active_routes_, std::vector<MediaRoute::Id>()));
+ NotifyPresentationConnectionStateChange(
+ route_id, content::PRESENTATION_CONNECTION_STATE_TERMINATED);
+}
+
+void MediaRouterAndroid::OnRouteClosedWithError(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ const JavaParamRef<jstring>& jmedia_route_id,
+ const JavaParamRef<jstring>& jmessage) {
+ MediaRoute::Id route_id = ConvertJavaStringToUTF8(env, jmedia_route_id);
+ std::string message = ConvertJavaStringToUTF8(env, jmessage);
+ NotifyPresentationConnectionClose(
+ route_id,
+ content::PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR,
+ message);
+
+ OnRouteClosed(env, obj, jmedia_route_id);
}
void MediaRouterAndroid::OnMessageSentResult(JNIEnv* env,
« no previous file with comments | « chrome/browser/media/android/router/media_router_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698