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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1370723002: Include viewport visibility checks for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: identical to PS4 on 1329853004 (probably rebased) Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 10 matching lines...) Expand all
21 #include "config.h" 21 #include "config.h"
22 #include "core/layout/LayoutView.h" 22 #include "core/layout/LayoutView.h"
23 23
24 #include "core/dom/Document.h" 24 #include "core/dom/Document.h"
25 #include "core/dom/Element.h" 25 #include "core/dom/Element.h"
26 #include "core/editing/FrameSelection.h" 26 #include "core/editing/FrameSelection.h"
27 #include "core/frame/LocalFrame.h" 27 #include "core/frame/LocalFrame.h"
28 #include "core/frame/Settings.h" 28 #include "core/frame/Settings.h"
29 #include "core/html/HTMLFrameOwnerElement.h" 29 #include "core/html/HTMLFrameOwnerElement.h"
30 #include "core/html/HTMLIFrameElement.h" 30 #include "core/html/HTMLIFrameElement.h"
31 #include "core/html/HTMLVideoElement.h"
31 #include "core/inspector/InspectorTraceEvents.h" 32 #include "core/inspector/InspectorTraceEvents.h"
32 #include "core/layout/HitTestResult.h" 33 #include "core/layout/HitTestResult.h"
33 #include "core/layout/LayoutFlowThread.h" 34 #include "core/layout/LayoutFlowThread.h"
34 #include "core/layout/LayoutGeometryMap.h" 35 #include "core/layout/LayoutGeometryMap.h"
36 #include "core/layout/LayoutMedia.h"
35 #include "core/layout/LayoutPart.h" 37 #include "core/layout/LayoutPart.h"
36 #include "core/layout/LayoutQuote.h" 38 #include "core/layout/LayoutQuote.h"
37 #include "core/layout/LayoutScrollbarPart.h" 39 #include "core/layout/LayoutScrollbarPart.h"
38 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 40 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
39 #include "core/page/Page.h" 41 #include "core/page/Page.h"
40 #include "core/paint/DeprecatedPaintLayer.h" 42 #include "core/paint/DeprecatedPaintLayer.h"
41 #include "core/paint/ViewPainter.h" 43 #include "core/paint/ViewPainter.h"
42 #include "core/svg/SVGDocumentExtensions.h" 44 #include "core/svg/SVGDocumentExtensions.h"
43 #include "platform/TraceEvent.h" 45 #include "platform/TraceEvent.h"
44 #include "platform/TracedValue.h" 46 #include "platform/TracedValue.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; 949 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1;
948 return viewHeight(IncludeScrollbars) / scale; 950 return viewHeight(IncludeScrollbars) / scale;
949 } 951 }
950 952
951 void LayoutView::willBeDestroyed() 953 void LayoutView::willBeDestroyed()
952 { 954 {
953 LayoutBlockFlow::willBeDestroyed(); 955 LayoutBlockFlow::willBeDestroyed();
954 m_compositor.clear(); 956 m_compositor.clear();
955 } 957 }
956 958
959 void LayoutView::registerMediaForPositionChangeNotification(LayoutMedia* media)
esprehn 2015/10/01 07:04:15 reference
liberato (no reviews please) 2015/10/01 22:49:03 done, though the vector must still be LayoutMedia*
960 {
961 if (!m_mediaForPositionNotification.contains(media))
962 m_mediaForPositionNotification.append(media);
963 }
964
965 void LayoutView::unregisterMediaForPositionChangeNotification(LayoutMedia* media )
esprehn 2015/10/01 07:04:15 reference
liberato (no reviews please) 2015/10/01 22:49:03 ditto.
966 {
967 size_t at = m_mediaForPositionNotification.find(media);
968 if (at != kNotFound)
969 m_mediaForPositionNotification.remove(at);
970 }
971
972 void LayoutView::sendMediaPositionChangeNotifications()
973 {
974 for (auto& media : m_mediaForPositionNotification) {
975 media->notifyPositionMayHaveChanged();
esprehn 2015/10/01 07:04:15 This isn't really the same timing as intersection
liberato (no reviews please) 2015/10/01 22:49:03 One of the objections to a prior iteration of this
976 }
977 }
978
957 } // namespace blink 979 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698