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

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

Issue 267893002: Catch intptr_t to int conversion on 64-bit platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Marcus' comment about quotes Created 6 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
« no previous file with comments | « base/android/jni_int_wrapper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 "content/browser/android/content_view_core_impl.h" 10 #include "content/browser/android/content_view_core_impl.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 void ContentVideoView::UpdateMediaMetadata() { 120 void ContentVideoView::UpdateMediaMetadata() {
121 JNIEnv* env = AttachCurrentThread(); 121 JNIEnv* env = AttachCurrentThread();
122 ScopedJavaLocalRef<jobject> content_video_view = GetJavaObject(env); 122 ScopedJavaLocalRef<jobject> content_video_view = GetJavaObject(env);
123 if (content_video_view.is_null()) 123 if (content_video_view.is_null())
124 return; 124 return;
125 125
126 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer(); 126 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer();
127 if (player && player->IsPlayerReady()) { 127 if (player && player->IsPlayerReady()) {
128 Java_ContentVideoView_onUpdateMediaMetadata( 128 Java_ContentVideoView_onUpdateMediaMetadata(
129 env, content_video_view.obj(), player->GetVideoWidth(), 129 env, content_video_view.obj(), player->GetVideoWidth(),
130 player->GetVideoHeight(), player->GetDuration().InMilliseconds(), 130 player->GetVideoHeight(),
131 static_cast<int>(player->GetDuration().InMilliseconds()),
131 player->CanPause(),player->CanSeekForward(), player->CanSeekBackward()); 132 player->CanPause(),player->CanSeekForward(), player->CanSeekBackward());
132 } 133 }
133 } 134 }
134 135
135 int ContentVideoView::GetVideoWidth(JNIEnv*, jobject obj) const { 136 int ContentVideoView::GetVideoWidth(JNIEnv*, jobject obj) const {
136 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer(); 137 media::MediaPlayerAndroid* player = manager_->GetFullscreenPlayer();
137 return player ? player->GetVideoWidth() : 0; 138 return player ? player->GetVideoWidth() : 0;
138 } 139 }
139 140
140 int ContentVideoView::GetVideoHeight(JNIEnv*, jobject obj) const { 141 int ContentVideoView::GetVideoHeight(JNIEnv*, jobject obj) const {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 231
231 if (power_save_blocker_) return; 232 if (power_save_blocker_) return;
232 233
233 power_save_blocker_ = PowerSaveBlocker::Create( 234 power_save_blocker_ = PowerSaveBlocker::Create(
234 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, 235 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep,
235 "Playing video").Pass(); 236 "Playing video").Pass();
236 static_cast<PowerSaveBlockerImpl*>(power_save_blocker_.get())-> 237 static_cast<PowerSaveBlockerImpl*>(power_save_blocker_.get())->
237 InitDisplaySleepBlocker(GetNativeView()); 238 InitDisplaySleepBlocker(GetNativeView());
238 } 239 }
239 } // namespace content 240 } // namespace content
OLDNEW
« no previous file with comments | « base/android/jni_int_wrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698