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