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

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: Add new test case, fix a bug :) 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 } 726 }
727 727
728 void AwContents::SetWindowVisibility(JNIEnv* env, jobject obj, bool visible) { 728 void AwContents::SetWindowVisibility(JNIEnv* env, jobject obj, bool visible) {
729 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 729 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
730 browser_view_renderer_->SetWindowVisibility(visible); 730 browser_view_renderer_->SetWindowVisibility(visible);
731 } 731 }
732 732
733 void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) { 733 void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) {
734 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 734 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
735 browser_view_renderer_->SetIsPaused(paused); 735 browser_view_renderer_->SetIsPaused(paused);
736 if (paused) { 736 ContentViewCore* cvc =
737 ContentViewCore* cvc = 737 ContentViewCore::FromWebContents(web_contents_.get());
738 ContentViewCore::FromWebContents(web_contents_.get()); 738 if (cvc) {
739 if (cvc) 739 cvc->PauseOrResumeGeolocation(paused);
740 if (paused) {
740 cvc->PauseVideo(); 741 cvc->PauseVideo();
742 }
741 } 743 }
742 } 744 }
743 745
744 void AwContents::OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h) { 746 void AwContents::OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h) {
745 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 747 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
746 browser_view_renderer_->OnAttachedToWindow(w, h); 748 browser_view_renderer_->OnAttachedToWindow(w, h);
747 } 749 }
748 750
749 void AwContents::OnDetachedFromWindow(JNIEnv* env, jobject obj) { 751 void AwContents::OnDetachedFromWindow(JNIEnv* env, jobject obj) {
750 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 752 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 void AwContents::TrimMemory(JNIEnv* env, jobject obj, jint level) { 983 void AwContents::TrimMemory(JNIEnv* env, jobject obj, jint level) {
982 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 984 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
983 browser_view_renderer_->TrimMemory(level); 985 browser_view_renderer_->TrimMemory(level);
984 } 986 }
985 987
986 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 988 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
987 g_should_download_favicons = true; 989 g_should_download_favicons = true;
988 } 990 }
989 991
990 } // namespace android_webview 992 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698