Index: content/browser/android/content_view_core_impl.cc |
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
index 7aa79eefc542720c2b9e04e982dd5930607d2fee..3f7624661b2b3d0bcf2d34933ecaab93bfabfb90 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -364,10 +364,15 @@ jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { |
} |
void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { |
- if (should_pause) |
- web_contents_->GetGeolocationServiceContext()->PauseUpdates(); |
- else |
- web_contents_->GetGeolocationServiceContext()->ResumeUpdates(); |
+ if (should_pause) { |
+ GeolocationServiceContext::GetOrCreateForWebContents(web_contents_) |
+ ->PauseUpdates(); |
+ } else { |
+ GeolocationServiceContext* geolocation_service_context = |
+ GeolocationServiceContext::FromWebContents(web_contents_); |
+ if (geolocation_service_context) |
+ geolocation_service_context->ResumeUpdates(); |
+ } |
} |
// All positions and sizes are in CSS pixels. |