| OLD | NEW |
| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 return java_ref_.get(env); | 349 return java_ref_.get(env); |
| 350 } | 350 } |
| 351 | 351 |
| 352 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { | 352 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { |
| 353 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 353 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
| 354 if (!rwhva) | 354 if (!rwhva) |
| 355 return SK_ColorWHITE; | 355 return SK_ColorWHITE; |
| 356 return rwhva->GetCachedBackgroundColor(); | 356 return rwhva->GetCachedBackgroundColor(); |
| 357 } | 357 } |
| 358 | 358 |
| 359 void ContentViewCoreImpl::PauseVideo() { | |
| 360 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( | |
| 361 web_contents_->GetRenderViewHost()); | |
| 362 if (rvhi) | |
| 363 rvhi->media_web_contents_observer()->PauseVideo(); | |
| 364 } | |
| 365 | |
| 366 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { | 359 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { |
| 367 web_contents_->geolocation_dispatcher_host()->PauseOrResume(should_pause); | 360 web_contents_->geolocation_dispatcher_host()->PauseOrResume(should_pause); |
| 368 } | 361 } |
| 369 | 362 |
| 370 // All positions and sizes are in CSS pixels. | 363 // All positions and sizes are in CSS pixels. |
| 371 // Note that viewport_width/height is a best effort based. | 364 // Note that viewport_width/height is a best effort based. |
| 372 // ContentViewCore has the actual information about the physical viewport size. | 365 // ContentViewCore has the actual information about the physical viewport size. |
| 373 void ContentViewCoreImpl::UpdateFrameInfo( | 366 void ContentViewCoreImpl::UpdateFrameInfo( |
| 374 const gfx::Vector2dF& scroll_offset, | 367 const gfx::Vector2dF& scroll_offset, |
| 375 float page_scale_factor, | 368 float page_scale_factor, |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1332 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1340 retained_objects_set); | 1333 retained_objects_set); |
| 1341 return reinterpret_cast<intptr_t>(view); | 1334 return reinterpret_cast<intptr_t>(view); |
| 1342 } | 1335 } |
| 1343 | 1336 |
| 1344 bool RegisterContentViewCore(JNIEnv* env) { | 1337 bool RegisterContentViewCore(JNIEnv* env) { |
| 1345 return RegisterNativesImpl(env); | 1338 return RegisterNativesImpl(env); |
| 1346 } | 1339 } |
| 1347 | 1340 |
| 1348 } // namespace content | 1341 } // namespace content |
| OLD | NEW |