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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 1991273003: Fire visibilityChange event on out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebView->WebFrame Created 4 years, 6 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 m_layerTreeView->attachCompositorAnimationTimeline(compositorTimeline->a nimationTimeline()); 1084 m_layerTreeView->attachCompositorAnimationTimeline(compositorTimeline->a nimationTimeline());
1085 1085
1086 } 1086 }
1087 1087
1088 void WebFrameWidgetImpl::detachCompositorAnimationTimeline(CompositorAnimationTi meline* compositorTimeline) 1088 void WebFrameWidgetImpl::detachCompositorAnimationTimeline(CompositorAnimationTi meline* compositorTimeline)
1089 { 1089 {
1090 if (m_layerTreeView) 1090 if (m_layerTreeView)
1091 m_layerTreeView->detachCompositorAnimationTimeline(compositorTimeline->a nimationTimeline()); 1091 m_layerTreeView->detachCompositorAnimationTimeline(compositorTimeline->a nimationTimeline());
1092 } 1092 }
1093 1093
1094 void WebFrameWidgetImpl::setVisibilityState(WebPageVisibilityState visibilitySta te, bool isInitialState) 1094 void WebFrameWidgetImpl::setVisibilityState(WebPageVisibilityState visibilitySta te)
1095 { 1095 {
1096 if (!page()) 1096 if (m_layerTreeView)
1097 return; 1097 m_layerTreeView->setVisible(visibilityState == WebPageVisibilityStateVis ible);
1098
1099 // FIXME: This is not correct, since Show and Hide messages for a frame's Wi dget do not necessarily
1100 // correspond to Page visibility, but is necessary until we properly sort ou t OOPIF visibility.
1101 page()->setVisibilityState(static_cast<PageVisibilityState>(visibilityState) , isInitialState);
1102
1103 m_localRoot->frame()->frameScheduler()->setPageVisible(visibilityState == We bPageVisibilityStateVisible);
1104
1105 if (m_layerTreeView) {
1106 bool visible = visibilityState == WebPageVisibilityStateVisible;
1107 m_layerTreeView->setVisible(visible);
1108 }
1109 } 1098 }
1110 1099
1111 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p osInRootFrame) 1100 HitTestResult WebFrameWidgetImpl::hitTestResultForRootFramePos(const IntPoint& p osInRootFrame)
1112 { 1101 {
1113 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo tFrame)); 1102 IntPoint docPoint(m_localRoot->frame()->view()->rootFrameToContents(posInRoo tFrame));
1114 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active); 1103 HitTestResult result = m_localRoot->frame()->eventHandler().hitTestResultAtP oint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
1115 result.setToShadowHostIfInUserAgentShadowRoot(); 1104 result.setToShadowHostIfInUserAgentShadowRoot();
1116 return result; 1105 return result;
1117 } 1106 }
1118 1107
1119 } // namespace blink 1108 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698