| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/media/android/router/media_router_android.h" | 5 #include "chrome/browser/media/android/router/media_router_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "jni/ChromeMediaRouter_jni.h" | 9 #include "jni/ChromeMediaRouter_jni.h" |
| 10 | 10 |
| 11 namespace media_router { | 11 namespace media_router { |
| 12 | 12 |
| 13 MediaRouterAndroid::MediaRouterAndroid(content::BrowserContext*) { | 13 MediaRouterAndroid::MediaRouterAndroid(content::BrowserContext*) { |
| 14 JNIEnv* env = base::android::AttachCurrentThread(); | 14 JNIEnv* env = base::android::AttachCurrentThread(); |
| 15 CHECK(env); | 15 CHECK(env); |
| 16 java_media_router_.Reset(Java_ChromeMediaRouter_create( | 16 java_media_router_.Reset(Java_ChromeMediaRouter_create( |
| 17 env, | 17 env, |
| 18 reinterpret_cast<intptr_t>(this), | 18 reinterpret_cast<intptr_t>(this), |
| 19 base::android::GetApplicationContext()));} | 19 base::android::GetApplicationContext())); |
| 20 } |
| 20 | 21 |
| 21 MediaRouterAndroid::~MediaRouterAndroid() { | 22 MediaRouterAndroid::~MediaRouterAndroid() { |
| 22 } | 23 } |
| 23 | 24 |
| 24 // static | 25 // static |
| 25 bool MediaRouterAndroid::Register(JNIEnv* env) { | 26 bool MediaRouterAndroid::Register(JNIEnv* env) { |
| 26 bool ret = RegisterNativesImpl(env); | 27 bool ret = RegisterNativesImpl(env); |
| 27 DCHECK(g_ChromeMediaRouter_clazz); | 28 DCHECK(g_ChromeMediaRouter_clazz); |
| 28 return ret; | 29 return ret; |
| 29 } | 30 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 NOTIMPLEMENTED(); | 88 NOTIMPLEMENTED(); |
| 88 } | 89 } |
| 89 void MediaRouterAndroid::RegisterIssuesObserver(IssuesObserver* observer) { | 90 void MediaRouterAndroid::RegisterIssuesObserver(IssuesObserver* observer) { |
| 90 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
| 91 } | 92 } |
| 92 void MediaRouterAndroid::UnregisterIssuesObserver(IssuesObserver* observer) { | 93 void MediaRouterAndroid::UnregisterIssuesObserver(IssuesObserver* observer) { |
| 93 NOTIMPLEMENTED(); | 94 NOTIMPLEMENTED(); |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace media_router | 97 } // namespace media_router |
| OLD | NEW |