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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 namespace { | 27 namespace { |
28 // There can only be one content video view at a time, this holds onto that | 28 // There can only be one content video view at a time, this holds onto that |
29 // singleton instance. | 29 // singleton instance. |
30 ContentVideoView* g_content_video_view = NULL; | 30 ContentVideoView* g_content_video_view = NULL; |
31 | 31 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 static ScopedJavaLocalRef<jobject> GetSingletonJavaContentVideoView(JNIEnv* env, | 34 static ScopedJavaLocalRef<jobject> GetSingletonJavaContentVideoView( |
35 jclass) { | 35 JNIEnv* env, |
| 36 const JavaParamRef<jclass>&) { |
36 if (g_content_video_view) | 37 if (g_content_video_view) |
37 return g_content_video_view->GetJavaObject(env); | 38 return g_content_video_view->GetJavaObject(env); |
38 else | 39 else |
39 return ScopedJavaLocalRef<jobject>(); | 40 return ScopedJavaLocalRef<jobject>(); |
40 } | 41 } |
41 | 42 |
42 bool ContentVideoView::RegisterContentVideoView(JNIEnv* env) { | 43 bool ContentVideoView::RegisterContentVideoView(JNIEnv* env) { |
43 return RegisterNativesImpl(env); | 44 return RegisterNativesImpl(env); |
44 } | 45 } |
45 | 46 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return JavaObjectWeakGlobalRef(env, nullptr); | 207 return JavaObjectWeakGlobalRef(env, nullptr); |
207 | 208 |
208 return JavaObjectWeakGlobalRef( | 209 return JavaObjectWeakGlobalRef( |
209 env, | 210 env, |
210 Java_ContentVideoView_createContentVideoView( | 211 Java_ContentVideoView_createContentVideoView( |
211 env, | 212 env, |
212 j_content_view_core.obj(), | 213 j_content_view_core.obj(), |
213 reinterpret_cast<intptr_t>(this)).obj()); | 214 reinterpret_cast<intptr_t>(this)).obj()); |
214 } | 215 } |
215 } // namespace content | 216 } // namespace content |
OLD | NEW |