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

Unified Diff: third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp

Issue 2813303005: [Blink>Media] Moving autoplay logic to AutoplayPolicy (Closed)
Patch Set: fixed event order for setMuted and added comments Created 3 years, 8 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
Index: third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
index a706ffbebf58d6ffeb1f3662d7f6c040aacbac87..c6bc0b1dd9dae87ba6671b7987bd4ee80d318163 100644
--- a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
+++ b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
@@ -9,6 +9,7 @@
#include "core/events/Event.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLMediaElement.h"
+#include "core/html/media/AutoplayPolicy.h"
#include "platform/Histogram.h"
#include "platform/wtf/CurrentTime.h"
#include "public/platform/Platform.h"
@@ -110,7 +111,8 @@ void AutoplayUmaHelper::OnAutoplayInitiated(AutoplaySource source) {
bool data_saver_enabled =
element_->GetDocument().GetSettings() &&
element_->GetDocument().GetSettings()->GetDataSaverEnabled();
- bool blocked_by_setting = !element_->IsAutoplayAllowedPerSettings();
+ bool blocked_by_setting =
+ !element_->autoplay_policy().IsAutoplayAllowedPerSettings();
if (data_saver_enabled && blocked_by_setting) {
blocked_muted_video_histogram.Count(

Powered by Google App Engine
This is Rietveld 408576698