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

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

Issue 570183002: Make the pause of video playback and video capture consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 6 years, 2 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return java_ref_.get(env); 348 return java_ref_.get(env);
349 } 349 }
350 350
351 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { 351 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) {
352 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); 352 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid();
353 if (!rwhva) 353 if (!rwhva)
354 return SK_ColorWHITE; 354 return SK_ColorWHITE;
355 return rwhva->GetCachedBackgroundColor(); 355 return rwhva->GetCachedBackgroundColor();
356 } 356 }
357 357
358 void ContentViewCoreImpl::PauseVideo() {
359 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(
360 web_contents_->GetRenderViewHost());
361 if (rvhi)
362 rvhi->media_web_contents_observer()->PauseVideo();
363 }
364
365 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { 358 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) {
366 web_contents_->geolocation_dispatcher_host()->PauseOrResume(should_pause); 359 web_contents_->geolocation_dispatcher_host()->PauseOrResume(should_pause);
367 } 360 }
368 361
369 // All positions and sizes are in CSS pixels. 362 // All positions and sizes are in CSS pixels.
370 // Note that viewport_width/height is a best effort based. 363 // Note that viewport_width/height is a best effort based.
371 // ContentViewCore has the actual information about the physical viewport size. 364 // ContentViewCore has the actual information about the physical viewport size.
372 void ContentViewCoreImpl::UpdateFrameInfo( 365 void ContentViewCoreImpl::UpdateFrameInfo(
373 const gfx::Vector2dF& scroll_offset, 366 const gfx::Vector2dF& scroll_offset,
374 float page_scale_factor, 367 float page_scale_factor,
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), 1331 reinterpret_cast<ui::WindowAndroid*>(window_android),
1339 retained_objects_set); 1332 retained_objects_set);
1340 return reinterpret_cast<intptr_t>(view); 1333 return reinterpret_cast<intptr_t>(view);
1341 } 1334 }
1342 1335
1343 bool RegisterContentViewCore(JNIEnv* env) { 1336 bool RegisterContentViewCore(JNIEnv* env) {
1344 return RegisterNativesImpl(env); 1337 return RegisterNativesImpl(env);
1345 } 1338 }
1346 1339
1347 } // namespace content 1340 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/media/android/browser_media_player_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698