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 "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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 void AwContents::SetViewVisibility(JNIEnv* env, jobject obj, bool visible) { | 685 void AwContents::SetViewVisibility(JNIEnv* env, jobject obj, bool visible) { |
686 browser_view_renderer_->SetViewVisibility(visible); | 686 browser_view_renderer_->SetViewVisibility(visible); |
687 } | 687 } |
688 | 688 |
689 void AwContents::SetWindowVisibility(JNIEnv* env, jobject obj, bool visible) { | 689 void AwContents::SetWindowVisibility(JNIEnv* env, jobject obj, bool visible) { |
690 browser_view_renderer_->SetWindowVisibility(visible); | 690 browser_view_renderer_->SetWindowVisibility(visible); |
691 } | 691 } |
692 | 692 |
693 void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) { | 693 void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) { |
694 browser_view_renderer_->SetIsPaused(paused); | 694 browser_view_renderer_->SetIsPaused(paused); |
695 if (paused) { | 695 ContentViewCore* cvc = |
696 ContentViewCore* cvc = | 696 ContentViewCore::FromWebContents(web_contents_.get()); |
697 ContentViewCore::FromWebContents(web_contents_.get()); | 697 if (cvc) { |
698 if (cvc) | 698 if (paused) { |
699 cvc->PauseVideo(); | 699 cvc->PauseVideo(); |
| 700 cvc->PauseGeolocation(); |
| 701 } else { |
| 702 cvc->ResumeGeolocation(); |
| 703 } |
700 } | 704 } |
701 } | 705 } |
702 | 706 |
703 void AwContents::OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h) { | 707 void AwContents::OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h) { |
704 browser_view_renderer_->OnAttachedToWindow(w, h); | 708 browser_view_renderer_->OnAttachedToWindow(w, h); |
705 } | 709 } |
706 | 710 |
707 void AwContents::OnDetachedFromWindow(JNIEnv* env, jobject obj) { | 711 void AwContents::OnDetachedFromWindow(JNIEnv* env, jobject obj) { |
708 browser_view_renderer_->OnDetachedFromWindow(); | 712 browser_view_renderer_->OnDetachedFromWindow(); |
709 } | 713 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 918 |
915 void AwContents::TrimMemory(JNIEnv* env, jobject obj, jint level) { | 919 void AwContents::TrimMemory(JNIEnv* env, jobject obj, jint level) { |
916 browser_view_renderer_->TrimMemory(level); | 920 browser_view_renderer_->TrimMemory(level); |
917 } | 921 } |
918 | 922 |
919 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 923 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
920 g_should_download_favicons = true; | 924 g_should_download_favicons = true; |
921 } | 925 } |
922 | 926 |
923 } // namespace android_webview | 927 } // namespace android_webview |
OLD | NEW |