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

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

Issue 2640023008: Enabling autoplay and fullscreen for downloaded media (Closed)
Patch Set: dtrainor@ comments 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') | chrome/browser/chrome_content_browser_client.cc » ('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 1eb487d3245864a136d75eeaefb1cb61c2b6f049..518d237030944c6dd43418a0df3e626832ff14ee 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"
@@ -126,7 +127,8 @@ TabAndroid::TabAndroid(JNIEnv* env, const JavaRef<jobject>& obj)
: weak_java_tab_(env, obj),
content_layer_(cc::Layer::Create()),
tab_content_manager_(NULL),
- synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) {
+ synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)),
+ embedded_media_experience_enabled_(false) {
Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this));
}
@@ -716,6 +718,22 @@ bool TabAndroid::HasPrerenderedUrl(JNIEnv* env,
return HasPrerenderedUrl(gurl);
}
+void TabAndroid::EnableEmbeddedMediaExperience(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jboolean enabled) {
+ embedded_media_experience_enabled_ = enabled;
+
+ if (!web_contents() || !web_contents()->GetRenderViewHost())
+ return;
+
+ web_contents()->GetRenderViewHost()->OnWebkitPreferencesChanged();
+}
+
+bool TabAndroid::ShouldEnableEmbeddedMediaExperience() const {
+ return embedded_media_experience_enabled_;
David Trainor- moved to gerrit 2017/02/23 21:15:25 Had a talk offline. Follow up is maybe we can che
shaktisahu 2017/02/23 22:43:27 Actually I checked this. We can't add that check h
+}
+
namespace {
class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate {
« no previous file with comments | « chrome/browser/android/tab_android.h ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698