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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 23464080: [Android] Decouple pausing video from RenderView pause. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months 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 "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 void ContentViewCoreImpl::Show() { 336 void ContentViewCoreImpl::Show() {
337 GetWebContents()->WasShown(); 337 GetWebContents()->WasShown();
338 // Displaying WebContents may trigger a lazy reload, spawning a new renderer 338 // Displaying WebContents may trigger a lazy reload, spawning a new renderer
339 // for the tab. 339 // for the tab.
340 UpdateTabCrashedFlag(); 340 UpdateTabCrashedFlag();
341 } 341 }
342 342
343 void ContentViewCoreImpl::Hide() { 343 void ContentViewCoreImpl::Hide() {
344 GetWebContents()->WasHidden(); 344 GetWebContents()->WasHidden();
345 PauseVideo();
345 } 346 }
346 347
348 void ContentViewCoreImpl::PauseVideo() {
349 RenderViewHost* host = web_contents_->GetRenderViewHost();
350 if (host)
351 host->Send(new ViewMsg_PauseVideo(host->GetRoutingID()));
352 }
353
354
joth 2013/09/19 02:41:50 \nn
benm (inactive) 2013/09/19 03:27:32 Done.
347 void ContentViewCoreImpl::OnTabCrashed() { 355 void ContentViewCoreImpl::OnTabCrashed() {
348 JNIEnv* env = AttachCurrentThread(); 356 JNIEnv* env = AttachCurrentThread();
349 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 357 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
350 if (obj.is_null()) 358 if (obj.is_null())
351 return; 359 return;
352 Java_ContentViewCore_resetVSyncNotification(env, obj.obj()); 360 Java_ContentViewCore_resetVSyncNotification(env, obj.obj());
353 361
354 // If |tab_crashed_| is already true, just return. e.g. if two tabs share the 362 // If |tab_crashed_| is already true, just return. e.g. if two tabs share the
355 // render process, this will be called for each tab when the render process 363 // render process, this will be called for each tab when the render process
356 // crashed. If user reload one tab, a new render process is created. It can be 364 // crashed. If user reload one tab, a new render process is created. It can be
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 reinterpret_cast<ui::ViewAndroid*>(view_android), 1610 reinterpret_cast<ui::ViewAndroid*>(view_android),
1603 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1611 reinterpret_cast<ui::WindowAndroid*>(window_android));
1604 return reinterpret_cast<jint>(view); 1612 return reinterpret_cast<jint>(view);
1605 } 1613 }
1606 1614
1607 bool RegisterContentViewCore(JNIEnv* env) { 1615 bool RegisterContentViewCore(JNIEnv* env) {
1608 return RegisterNativesImpl(env); 1616 return RegisterNativesImpl(env);
1609 } 1617 }
1610 1618
1611 } // namespace content 1619 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698