Chromium Code Reviews| Index: chrome/browser/media/android/router/media_router_dialog_controller_android.cc |
| diff --git a/chrome/browser/media/android/router/media_router_dialog_controller_android.cc b/chrome/browser/media/android/router/media_router_dialog_controller_android.cc |
| index 88d1fd933eb628f3cc4114cf26302cc3fbd80b7b..ac31a972dff831cf8000d149026d9e7f1bc83223 100644 |
| --- a/chrome/browser/media/android/router/media_router_dialog_controller_android.cc |
| +++ b/chrome/browser/media/android/router/media_router_dialog_controller_android.cc |
| @@ -4,9 +4,11 @@ |
| #include "chrome/browser/media/android/router/media_router_dialog_controller_android.h" |
| +#include "base/android/jni_android.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_contents_delegate.h" |
| +#include "jni/ChromeMediaRouterDialogController_jni.h" |
| DEFINE_WEB_CONTENTS_USER_DATA_KEY( |
| media_router::MediaRouterDialogControllerAndroid); |
| @@ -28,6 +30,19 @@ MediaRouterDialogControllerAndroid::GetOrCreateForWebContents( |
| MediaRouterDialogControllerAndroid::MediaRouterDialogControllerAndroid( |
| WebContents* web_contents) |
| : MediaRouterDialogController(web_contents) { |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
| + CHECK(env); |
|
Bernhard Bauer
2015/08/06 15:23:01
Is this CHECK actually necessary? I would only exp
whywhat
2015/08/06 15:27:13
I'd think in such exceptional circumstances one sh
Bernhard Bauer
2015/08/06 15:40:33
I have never seen it, TBH. If anything, we should
whywhat
2015/08/06 16:29:20
Ok, CHECK removed.
|
| + java_dialog_controller_.Reset(Java_ChromeMediaRouterDialogController_create( |
| + env, |
| + reinterpret_cast<intptr_t>(this), |
| + base::android::GetApplicationContext())); |
| +} |
| + |
| +// static |
| +bool MediaRouterDialogControllerAndroid::Register(JNIEnv* env) { |
| + bool ret = RegisterNativesImpl(env); |
| + DCHECK(g_ChromeMediaRouterDialogController_clazz); |
| + return ret; |
| } |
| MediaRouterDialogControllerAndroid::~MediaRouterDialogControllerAndroid() { |