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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 } | 357 } |
358 | 358 |
359 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { | 359 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { |
360 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 360 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
361 if (!rwhva) | 361 if (!rwhva) |
362 return SK_ColorWHITE; | 362 return SK_ColorWHITE; |
363 return rwhva->GetCachedBackgroundColor(); | 363 return rwhva->GetCachedBackgroundColor(); |
364 } | 364 } |
365 | 365 |
366 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { | 366 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { |
367 if (should_pause) | 367 if (should_pause) { |
368 web_contents_->GetGeolocationServiceContext()->PauseUpdates(); | 368 GeolocationServiceContext::GetOrCreateForWebContents(web_contents_) |
369 else | 369 ->PauseUpdates(); |
370 web_contents_->GetGeolocationServiceContext()->ResumeUpdates(); | 370 } else { |
371 auto geolocation_service_context = | |
Anand Mistry (off Chromium)
2015/11/10 04:53:39
Why the difference?
Sam McNally
2015/11/11 07:04:02
Pausing should create the context so that if the f
| |
372 GeolocationServiceContext::FromWebContents(web_contents_); | |
373 if (geolocation_service_context) | |
374 geolocation_service_context->ResumeUpdates(); | |
375 } | |
371 } | 376 } |
372 | 377 |
373 // All positions and sizes are in CSS pixels. | 378 // All positions and sizes are in CSS pixels. |
374 // Note that viewport_width/height is a best effort based. | 379 // Note that viewport_width/height is a best effort based. |
375 // ContentViewCore has the actual information about the physical viewport size. | 380 // ContentViewCore has the actual information about the physical viewport size. |
376 void ContentViewCoreImpl::UpdateFrameInfo( | 381 void ContentViewCoreImpl::UpdateFrameInfo( |
377 const gfx::Vector2dF& scroll_offset, | 382 const gfx::Vector2dF& scroll_offset, |
378 float page_scale_factor, | 383 float page_scale_factor, |
379 const gfx::Vector2dF& page_scale_factor_limits, | 384 const gfx::Vector2dF& page_scale_factor_limits, |
380 const gfx::SizeF& content_size, | 385 const gfx::SizeF& content_size, |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1454 return ScopedJavaLocalRef<jobject>(); | 1459 return ScopedJavaLocalRef<jobject>(); |
1455 | 1460 |
1456 return view->GetJavaObject(); | 1461 return view->GetJavaObject(); |
1457 } | 1462 } |
1458 | 1463 |
1459 bool RegisterContentViewCore(JNIEnv* env) { | 1464 bool RegisterContentViewCore(JNIEnv* env) { |
1460 return RegisterNativesImpl(env); | 1465 return RegisterNativesImpl(env); |
1461 } | 1466 } |
1462 | 1467 |
1463 } // namespace content | 1468 } // namespace content |
OLD | NEW |