Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/android/content_video_view.h" | 5 #include "content/browser/android/content_video_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "content/browser/android/content_view_core_impl.h" | 11 #include "content/browser/android/content_view_core_impl.h" |
|
no sievers
2015/11/02 22:27:15
also don't include content_view_core_impl.h on AUR
mfomitchev
2015/11/03 22:23:19
Done.
| |
| 12 #include "content/browser/media/android/browser_media_player_manager.h" | 12 #include "content/browser/media/android/browser_media_player_manager.h" |
| 13 #include "content/browser/power_save_blocker_impl.h" | 13 #include "content/browser/power_save_blocker_impl.h" |
| 14 #include "content/common/android/surface_texture_peer.h" | 14 #include "content/common/android/surface_texture_peer.h" |
| 15 #include "content/public/browser/user_metrics.h" | 15 #include "content/public/browser/user_metrics.h" |
| 16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 17 #include "jni/ContentVideoView_jni.h" | 17 #include "jni/ContentVideoView_jni.h" |
| 18 | 18 |
| 19 using base::android::AttachCurrentThread; | 19 using base::android::AttachCurrentThread; |
| 20 using base::android::CheckException; | 20 using base::android::CheckException; |
| 21 using base::android::ScopedJavaGlobalRef; | 21 using base::android::ScopedJavaGlobalRef; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 FROM_HERE, | 191 FROM_HERE, |
| 192 base::Bind(&ContentVideoView::UpdateMediaMetadata, | 192 base::Bind(&ContentVideoView::UpdateMediaMetadata, |
| 193 weak_factory_.GetWeakPtr())); | 193 weak_factory_.GetWeakPtr())); |
| 194 } | 194 } |
| 195 | 195 |
| 196 ScopedJavaLocalRef<jobject> ContentVideoView::GetJavaObject(JNIEnv* env) { | 196 ScopedJavaLocalRef<jobject> ContentVideoView::GetJavaObject(JNIEnv* env) { |
| 197 return j_content_video_view_.get(env); | 197 return j_content_video_view_.get(env); |
| 198 } | 198 } |
| 199 | 199 |
| 200 JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { | 200 JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { |
| 201 | |
| 202 JNIEnv* env = AttachCurrentThread(); | |
| 203 base::android::ScopedJavaLocalRef<jobject> j_content_view_core; | |
| 204 | |
| 205 #if !defined(USE_AURA) | |
|
no sievers
2015/11/02 22:27:15
can you TODO(crbug.com/548024)?
mfomitchev
2015/11/03 22:23:19
Done.
| |
| 201 ContentViewCore* content_view_core = manager_->GetContentViewCore(); | 206 ContentViewCore* content_view_core = manager_->GetContentViewCore(); |
| 202 JNIEnv* env = AttachCurrentThread(); | 207 j_content_view_core = content_view_core->GetJavaObject(); |
| 208 #endif | |
| 203 | 209 |
| 204 base::android::ScopedJavaLocalRef<jobject> j_content_view_core = | |
| 205 content_view_core->GetJavaObject(); | |
| 206 if (j_content_view_core.is_null()) | 210 if (j_content_view_core.is_null()) |
| 207 return JavaObjectWeakGlobalRef(env, nullptr); | 211 return JavaObjectWeakGlobalRef(env, nullptr); |
| 208 | 212 |
| 209 return JavaObjectWeakGlobalRef( | 213 return JavaObjectWeakGlobalRef( |
| 210 env, | 214 env, |
| 211 Java_ContentVideoView_createContentVideoView( | 215 Java_ContentVideoView_createContentVideoView( |
| 212 env, | 216 env, |
| 213 j_content_view_core.obj(), | 217 j_content_view_core.obj(), |
| 214 reinterpret_cast<intptr_t>(this)).obj()); | 218 reinterpret_cast<intptr_t>(this)).obj()); |
| 215 } | 219 } |
| 216 } // namespace content | 220 } // namespace content |
| OLD | NEW |