Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: content/browser/android/content_video_view.h

Issue 15035013: Keep screen on when there is an active WebRTC session on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: code review: nits Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698