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

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

Issue 65273002: Add a mechanism to pause and resume geolocation requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: joth comments Created 7 years, 1 month 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 GetWebContents()->WasHidden(); 341 GetWebContents()->WasHidden();
342 PauseVideo(); 342 PauseVideo();
343 } 343 }
344 344
345 void ContentViewCoreImpl::PauseVideo() { 345 void ContentViewCoreImpl::PauseVideo() {
346 RenderViewHost* host = web_contents_->GetRenderViewHost(); 346 RenderViewHost* host = web_contents_->GetRenderViewHost();
347 if (host) 347 if (host)
348 host->Send(new ViewMsg_PauseVideo(host->GetRoutingID())); 348 host->Send(new ViewMsg_PauseVideo(host->GetRoutingID()));
349 } 349 }
350 350
351 void ContentViewCoreImpl::PauseGeolocation() {
352 RenderViewHostImpl* rvh =
353 static_cast<RenderViewHostImpl*>(web_contents_->GetRenderViewHost());
354 if (rvh) {
355 rvh->PauseGeolocation();
356 }
joth 2013/11/10 17:59:02 I think we could skip the RenderViewHostImpl altog
benm (inactive) 2013/11/11 14:50:41 Done.
357 }
358
359 void ContentViewCoreImpl::ResumeGeolocation() {
360 RenderViewHostImpl* rvh =
361 static_cast<RenderViewHostImpl*>(web_contents_->GetRenderViewHost());
362 if (rvh) {
363 rvh->ResumeGeolocation();
364 }
365 }
366
351 void ContentViewCoreImpl::OnTabCrashed() { 367 void ContentViewCoreImpl::OnTabCrashed() {
352 JNIEnv* env = AttachCurrentThread(); 368 JNIEnv* env = AttachCurrentThread();
353 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 369 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
354 if (obj.is_null()) 370 if (obj.is_null())
355 return; 371 return;
356 Java_ContentViewCore_resetVSyncNotification(env, obj.obj()); 372 Java_ContentViewCore_resetVSyncNotification(env, obj.obj());
357 373
358 // Note that we might reach this place multiple times while the 374 // Note that we might reach this place multiple times while the
359 // ContentViewCore remains crashed. E.g. if two tabs share the render process 375 // ContentViewCore remains crashed. E.g. if two tabs share the render process
360 // and the process crashes, this will be called for each tab. If the user 376 // and the process crashes, this will be called for each tab. If the user
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 reinterpret_cast<ui::ViewAndroid*>(view_android), 1665 reinterpret_cast<ui::ViewAndroid*>(view_android),
1650 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1666 reinterpret_cast<ui::WindowAndroid*>(window_android));
1651 return reinterpret_cast<jint>(view); 1667 return reinterpret_cast<jint>(view);
1652 } 1668 }
1653 1669
1654 bool RegisterContentViewCore(JNIEnv* env) { 1670 bool RegisterContentViewCore(JNIEnv* env) {
1655 return RegisterNativesImpl(env); 1671 return RegisterNativesImpl(env);
1656 } 1672 }
1657 1673
1658 } // namespace content 1674 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698