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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java

Issue 1463693002: [Cast,Android] Subscribe to onCancel and onDismiss correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the comments. Created 5 years, 1 month 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
Index: chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java
index d294354e0a2e2391eaf9fd3502570cdf53e22079..4d21c7d96e49e573d48db8865f04a9d5ceebdca2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java
@@ -104,6 +104,12 @@ public class ChromeMediaRouterDialogController implements MediaRouteDialogDelega
@Override
public void onDialogCancelled() {
+ // For MediaRouteControllerDialog this method will be called in case the route is closed
+ // since it only call onDismiss() and there's no way to distinguish between the two.
+ // Here we can figure it out: if mDialogManager is null, onRouteClosed() was called and
+ // there's no need to tell the native controller the dialog has been cancelled.
+ if (mDialogManager == null) return;
+
mDialogManager = null;
nativeOnDialogCancelled(mNativeDialogController);
}

Powered by Google App Engine
This is Rietveld 408576698