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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |