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

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

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 #include "content/browser/android/content_video_view.h" 5 #include "content/browser/android/content_video_view.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/android/media_player_manager_impl.h" 10 #include "content/browser/android/media_player_manager_impl.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 } 43 }
44 44
45 void ContentVideoView::DestroyContentVideoView() { 45 void ContentVideoView::DestroyContentVideoView() {
46 if (!j_content_video_view_.is_null()) { 46 if (!j_content_video_view_.is_null()) {
47 Java_ContentVideoView_destroyContentVideoView(AttachCurrentThread()); 47 Java_ContentVideoView_destroyContentVideoView(AttachCurrentThread());
48 j_content_video_view_.Reset(); 48 j_content_video_view_.Reset();
49 } 49 }
50 } 50 }
51 51
52 // static
53 void ContentVideoView::KeepScreenOn(bool screen_on) {
54 Java_ContentVideoView_keepScreenOnContentVideoView(AttachCurrentThread(),
55 screen_on);
56 }
57
52 void ContentVideoView::OnMediaPlayerError(int error_type) { 58 void ContentVideoView::OnMediaPlayerError(int error_type) {
53 if (!j_content_video_view_.is_null()) { 59 if (!j_content_video_view_.is_null()) {
54 Java_ContentVideoView_onMediaPlayerError(AttachCurrentThread(), 60 Java_ContentVideoView_onMediaPlayerError(AttachCurrentThread(),
55 j_content_video_view_.obj(), 61 j_content_video_view_.obj(),
56 error_type); 62 error_type);
57 } 63 }
58 } 64 }
59 65
60 void ContentVideoView::OnVideoSizeChanged(int width, int height) { 66 void ContentVideoView::OnVideoSizeChanged(int width, int height) {
61 if (!j_content_video_view_.is_null()) { 67 if (!j_content_video_view_.is_null()) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 void ContentVideoView::UpdateMediaMetadata(JNIEnv* env, jobject obj) { 143 void ContentVideoView::UpdateMediaMetadata(JNIEnv* env, jobject obj) {
138 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer(); 144 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer();
139 if (player && player->IsPlayerReady()) 145 if (player && player->IsPlayerReady())
140 Java_ContentVideoView_updateMediaMetadata( 146 Java_ContentVideoView_updateMediaMetadata(
141 env, obj, player->GetVideoWidth(), player->GetVideoHeight(), 147 env, obj, player->GetVideoWidth(), player->GetVideoHeight(),
142 player->GetDuration().InMilliseconds(), player->CanPause(), 148 player->GetDuration().InMilliseconds(), player->CanPause(),
143 player->CanSeekForward(), player->CanSeekBackward()); 149 player->CanSeekForward(), player->CanSeekBackward());
144 } 150 }
145 151
146 } // namespace content 152 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_video_view.h ('k') | content/browser/power_save_blocker_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698