Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java |
| index 34de628d52b9530ec35764e31da58cc56386eb24..fdb761abf89c033b91aae39bf30ce8f73b53711c 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java |
| @@ -17,6 +17,7 @@ import com.google.android.gms.common.api.Status; |
| import org.chromium.base.Log; |
| import org.chromium.chrome.browser.media.router.ChromeMediaRouter; |
| +import org.chromium.chrome.browser.media.router.MediaRoute; |
| import org.chromium.chrome.browser.media.router.RouteDelegate; |
| /** |
| @@ -28,7 +29,7 @@ import org.chromium.chrome.browser.media.router.RouteDelegate; |
| public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks, |
| GoogleApiClient.OnConnectionFailedListener, |
| ResultCallback<Cast.ApplicationConnectionResult> { |
| - private static final String TAG = "cr.MediaRouter"; |
| + private static final String TAG = "cr_MediaRouter"; |
|
mlamouri (slow - plz ping)
2015/11/27 14:23:39
I have to say that I'm getting annoyed by that pre
whywhat
2015/11/27 19:44:39
Cool. Ack.
|
| private static final int STATE_IDLE = 0; |
| private static final int STATE_CONNECTING_TO_API = 1; |
| @@ -84,7 +85,7 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks, |
| private final MediaSource mSource; |
| private final MediaSink mSink; |
| - private final String mRouteId; |
| + private final String mPresentationId; |
| private final String mOrigin; |
| private final int mTabId; |
| private final int mRequestId; |
| @@ -96,19 +97,19 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks, |
| /** |
| * Initializes the request. |
| - * @param source The {@link MediaSource} defining the application to launch on the Cast device |
| - * @param sink The {@link MediaSink} identifying the selected Cast device |
| - * @param routeId The id assigned to the route by {@link ChromeMediaRouter} |
| + * @param source The {@link MediaSource} defining the application to launch on the Cast device. |
| + * @param sink The {@link MediaSink} identifying the selected Cast device. |
| + * @param presentationId The presentation id assigned to the route by {@link ChromeMediaRouter}. |
| * @param origin The origin of the frame requesting the route. |
| * @param tabId the id of the tab containing the frame requesting the route. |
| * @param requestId The id of the route creation request for tracking by |
| - * {@link ChromeMediaRouter} |
| - * @param delegate The instance of {@link RouteDelegate} handling the request |
| + * {@link ChromeMediaRouter}. |
| + * @param delegate The instance of {@link RouteDelegate} handling the request. |
| */ |
| public CreateRouteRequest( |
| MediaSource source, |
| MediaSink sink, |
| - String routeId, |
| + String presentationId, |
| String origin, |
| int tabId, |
| int requestId, |
| @@ -118,7 +119,7 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks, |
| mSource = source; |
| mSink = sink; |
| - mRouteId = routeId; |
| + mPresentationId = presentationId; |
| mOrigin = origin; |
| mTabId = tabId; |
| mRequestId = requestId; |
| @@ -223,19 +224,20 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks, |
| private void reportSuccess(Cast.ApplicationConnectionResult result) { |
| if (mState != STATE_LAUNCH_SUCCEEDED) throwInvalidState(); |
| + MediaRoute route = new MediaRoute(mSink.getId(), mSource.getUrn(), mPresentationId); |
| CastRouteController session = new CastRouteController( |
| mApiClient, |
| result.getSessionId(), |
| result.getApplicationMetadata(), |
| result.getApplicationStatus(), |
| mSink.getDevice(), |
| - mRouteId, |
| + route.id, |
| mOrigin, |
| mTabId, |
| mSource, |
| mDelegate); |
| mCastListener.setSession(session); |
| - mDelegate.onRouteCreated(mRequestId, session, result.getWasLaunched()); |
| + mDelegate.onRouteCreated(mRequestId, route, session); |
| terminate(); |
| } |