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 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // it. It accepts media control from Java class, and forwards it to | 22 // it. It accepts media control from Java class, and forwards it to |
23 // MediaPlayerManagerImpl. | 23 // MediaPlayerManagerImpl. |
24 class ContentVideoView { | 24 class ContentVideoView { |
25 public: | 25 public: |
26 // Construct a ContentVideoView object. The |manager| will handle all the | 26 // Construct a ContentVideoView object. The |manager| will handle all the |
27 // playback controls from the Java class. | 27 // playback controls from the Java class. |
28 explicit ContentVideoView(MediaPlayerManagerImpl* manager); | 28 explicit ContentVideoView(MediaPlayerManagerImpl* manager); |
29 ~ContentVideoView(); | 29 ~ContentVideoView(); |
30 | 30 |
31 static bool RegisterContentVideoView(JNIEnv* env); | 31 static bool RegisterContentVideoView(JNIEnv* env); |
| 32 static void KeepScreenOn(bool screen_on); |
32 | 33 |
33 // Getter method called by the Java class to get the media information. | 34 // Getter method called by the Java class to get the media information. |
34 int GetVideoWidth(JNIEnv*, jobject obj) const; | 35 int GetVideoWidth(JNIEnv*, jobject obj) const; |
35 int GetVideoHeight(JNIEnv*, jobject obj) const; | 36 int GetVideoHeight(JNIEnv*, jobject obj) const; |
36 int GetDurationInMilliSeconds(JNIEnv*, jobject obj) const; | 37 int GetDurationInMilliSeconds(JNIEnv*, jobject obj) const; |
37 int GetCurrentPosition(JNIEnv*, jobject obj) const; | 38 int GetCurrentPosition(JNIEnv*, jobject obj) const; |
38 bool IsPlaying(JNIEnv*, jobject obj); | 39 bool IsPlaying(JNIEnv*, jobject obj); |
39 void UpdateMediaMetadata(JNIEnv*, jobject obj); | 40 void UpdateMediaMetadata(JNIEnv*, jobject obj); |
40 | 41 |
41 // Method to create and destroy the Java view. | 42 // Method to create and destroy the Java view. |
(...skipping 28 matching lines...) Expand all Loading... |
70 | 71 |
71 // Reference to the Java object. | 72 // Reference to the Java object. |
72 base::android::ScopedJavaGlobalRef<jobject> j_content_video_view_; | 73 base::android::ScopedJavaGlobalRef<jobject> j_content_video_view_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); | 75 DISALLOW_COPY_AND_ASSIGN(ContentVideoView); |
75 }; | 76 }; |
76 | 77 |
77 } // namespace content | 78 } // namespace content |
78 | 79 |
79 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ | 80 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIDEO_VIEW_H_ |
OLD | NEW |