| 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 7b7736e430d7d70d440526e8155130b78dbcb1d9..ed6bafeea171b1422802641f910f75e2ed6a3a16 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
|
| @@ -5,7 +5,6 @@
|
| package org.chromium.chrome.browser.media.router.cast;
|
|
|
| import android.annotation.SuppressLint;
|
| -import android.content.Context;
|
| import android.os.Bundle;
|
|
|
| import com.google.android.gms.cast.ApplicationMetadata;
|
| @@ -18,6 +17,7 @@ import com.google.android.gms.common.api.PendingResult;
|
| import com.google.android.gms.common.api.ResultCallback;
|
| import com.google.android.gms.common.api.Status;
|
|
|
| +import org.chromium.base.ContextUtils;
|
| import org.chromium.base.Log;
|
| import org.chromium.chrome.browser.media.router.ChromeMediaRouter;
|
| import org.chromium.chrome.browser.media.router.MediaRoute;
|
| @@ -164,15 +164,11 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks,
|
|
|
| /**
|
| * Starts the process of launching the application on the Cast device.
|
| - * @param applicationContext application context
|
| - * implementation provided by the caller.
|
| */
|
| - public void start(Context applicationContext) {
|
| - assert applicationContext != null;
|
| -
|
| + public void start() {
|
| if (mState != STATE_IDLE) throwInvalidState();
|
|
|
| - mApiClient = createApiClient(mCastListener, applicationContext);
|
| + mApiClient = createApiClient(mCastListener);
|
| mApiClient.connect();
|
| mState = STATE_CONNECTING_TO_API;
|
| }
|
| @@ -233,13 +229,13 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks,
|
| reportError();
|
| }
|
|
|
| - private GoogleApiClient createApiClient(Cast.Listener listener, Context context) {
|
| + private GoogleApiClient createApiClient(Cast.Listener listener) {
|
| Cast.CastOptions.Builder apiOptionsBuilder =
|
| new Cast.CastOptions.Builder(mSink.getDevice(), listener)
|
| // TODO(avayvod): hide this behind the flag or remove
|
| .setVerboseLoggingEnabled(true);
|
|
|
| - return new GoogleApiClient.Builder(context)
|
| + return new GoogleApiClient.Builder(ContextUtils.getApplicationContext())
|
| .addApi(Cast.API, apiOptionsBuilder.build())
|
| .addConnectionCallbacks(this)
|
| .addOnConnectionFailedListener(this)
|
|
|