| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/html/AutoplayExperimentHelper.h" | 5 #include "core/html/AutoplayExperimentHelper.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLMediaElement.h" | 9 #include "core/html/HTMLMediaElement.h" |
| 10 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 return; | 490 return; |
| 491 | 491 |
| 492 m_recordedElement = true; | 492 m_recordedElement = true; |
| 493 recordAutoplayMetric(client().isHTMLVideoElement() | 493 recordAutoplayMetric(client().isHTMLVideoElement() |
| 494 ? AnyVideoElement | 494 ? AnyVideoElement |
| 495 : AnyAudioElement); | 495 : AnyAudioElement); |
| 496 } | 496 } |
| 497 | 497 |
| 498 bool AutoplayExperimentHelper::requiresViewportVisibility() const | 498 bool AutoplayExperimentHelper::requiresViewportVisibility() const |
| 499 { | 499 { |
| 500 return enabled(IfViewport) || enabled(IfPartialViewport); | 500 return client().isHTMLVideoElement() && (enabled(IfViewport) || enabled(IfPa
rtialViewport)); |
| 501 } | 501 } |
| 502 | 502 |
| 503 bool AutoplayExperimentHelper::isExperimentEnabled() | 503 bool AutoplayExperimentHelper::isExperimentEnabled() |
| 504 { | 504 { |
| 505 return m_mode != Mode::ExperimentOff; | 505 return m_mode != Mode::ExperimentOff; |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace blink | 508 } // namespace blink |
| OLD | NEW |