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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2640143002: Allow autoplay unmuted for WebAPK in the manifest scope (Closed)
Patch Set: addressed nits 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.cc ('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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 9b0b2bbac62e8c23b2bf8926361a37cfd785ac39..e5cd8e4080698227a511ac3f7a9f199eb08b7b58 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -268,6 +268,7 @@
#include "chrome/browser/android/devtools_manager_delegate_android.h"
#include "chrome/browser/android/ntp/new_tab_page_url_handler.h"
#include "chrome/browser/android/service_tab_launcher.h"
+#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h"
#include "components/payments/payment_request.mojom.h"
#include "content/public/browser/android/java_interfaces.h"
@@ -2581,6 +2582,18 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
web_prefs->data_saver_enabled = GetDataSaverEnabledPref(prefs);
+#if defined(OS_ANDROID)
+ content::WebContents* contents =
+ content::WebContents::FromRenderViewHost(rvh);
+ if (contents) {
+ TabAndroid* tab_android = TabAndroid::FromWebContents(contents);
+ if (tab_android) {
+ web_prefs->media_playback_gesture_whitelist_scope =
+ tab_android->GetWebappManifestScope();
+ }
+ }
+#endif // defined(OS_ANDROID)
+
for (size_t i = 0; i < extra_parts_.size(); ++i)
extra_parts_[i]->OverrideWebkitPrefs(rvh, web_prefs);
}
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698