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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 = | |
738 ContentViewCore::FromWebContents(web_contents_.get()); | 737 ContentViewCore::FromWebContents(web_contents_.get()); |
739 if (cvc) | 738 if (cvc) { |
qinmin
2013/12/06 00:10:13
remove nested loops.
if(!cvc)
return;
if(pause
kbalazs
2013/12/06 19:15:03
Done.
| |
739 if (paused) | |
740 cvc->PauseVideo(); | 740 cvc->PauseVideo(); |
741 else | |
742 cvc->ResumeVideo(); | |
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 Loading... | |
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 |
OLD | NEW |