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

Side by Side Diff: android_webview/native/aw_contents.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: Created 7 years 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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 } 730 }
731 731
732 void AwContents::SetWindowVisibility(JNIEnv* env, jobject obj, bool visible) { 732 void AwContents::SetWindowVisibility(JNIEnv* env, jobject obj, bool visible) {
733 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 733 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
734 browser_view_renderer_->SetWindowVisibility(visible); 734 browser_view_renderer_->SetWindowVisibility(visible);
735 } 735 }
736 736
737 void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) { 737 void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) {
738 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 738 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
739 browser_view_renderer_->SetIsPaused(paused); 739 browser_view_renderer_->SetIsPaused(paused);
740 if (paused) { 740 ContentViewCore* cvc =
741 ContentViewCore* cvc = 741 ContentViewCore::FromWebContents(web_contents_.get());
742 ContentViewCore::FromWebContents(web_contents_.get()); 742 if (cvc) {
743 if (cvc) 743 cvc->PauseOrResumeGeolocation(paused);
744 if (paused) {
744 cvc->PauseVideo(); 745 cvc->PauseVideo();
746 }
745 } 747 }
746 } 748 }
747 749
748 void AwContents::OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h) { 750 void AwContents::OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h) {
749 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 751 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
750 browser_view_renderer_->OnAttachedToWindow(w, h); 752 browser_view_renderer_->OnAttachedToWindow(w, h);
751 } 753 }
752 754
753 void AwContents::OnDetachedFromWindow(JNIEnv* env, jobject obj) { 755 void AwContents::OnDetachedFromWindow(JNIEnv* env, jobject obj) {
754 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 756 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 void AwContents::TrimMemory(JNIEnv* env, jobject obj, jint level) { 999 void AwContents::TrimMemory(JNIEnv* env, jobject obj, jint level) {
998 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1000 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
999 browser_view_renderer_->TrimMemory(level); 1001 browser_view_renderer_->TrimMemory(level);
1000 } 1002 }
1001 1003
1002 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1004 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1003 g_should_download_favicons = true; 1005 g_should_download_favicons = true;
1004 } 1006 }
1005 1007
1006 } // namespace android_webview 1008 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698