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

Unified Diff: chrome/browser/android/tab_android.cc

Issue 2640023008: Enabling autoplay and fullscreen for downloaded media (Closed)
Patch Set: Added a single pref Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 421ec3dfe30464342678a851c699dc5254197e65..e97c04f6a310f82fe757283559ae4e11b6600374 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -73,6 +73,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/browser_controls_state.h"
#include "content/public/common/resource_request_body.h"
+#include "content/public/common/web_preferences.h"
#include "jni/Tab_jni.h"
#include "net/base/escape.h"
#include "skia/ext/image_operations.h"
@@ -716,6 +717,19 @@ bool TabAndroid::HasPrerenderedUrl(JNIEnv* env,
return HasPrerenderedUrl(gurl);
}
+void TabAndroid::ConfigureEmbeddedMediaExperience(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj) {
+ content::RenderViewHost* host = web_contents()->GetRenderViewHost();
+ if (!host)
+ return;
+
+ content::WebPreferences prefs = host->GetWebkitPreferences();
+ prefs.user_gesture_required_for_media_playback = false;
mlamouri (slow - plz ping) 2017/02/17 10:01:43 Is it needed? Can't you simply autoplay from C++ t
shaktisahu 2017/02/17 19:18:06 Done. Thanks!
+ prefs.embedded_media_experience_enabled = true;
+ host->UpdateWebkitPreferences(prefs);
mlamouri (slow - plz ping) 2017/02/17 10:01:43 That does not sound correct because if any one cal
shaktisahu 2017/02/17 19:18:06 I looked around and didn't find any function that
mlamouri (slow - plz ping) 2017/02/20 11:31:50 The issue is that you are calling UpdateWebkitPref
shaktisahu 2017/02/21 07:02:56 Done. Thanks! I think this is especially useful fo
+}
+
namespace {
class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate {
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698