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

Unified Diff: Source/core/page/Page.cpp

Issue 18777003: Extract simpler classes for observing context lifecycle and observe Page lifecycle inNavigatorVibra… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined~ Created 7 years, 5 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 | « Source/core/page/Page.h ('k') | Source/modules/vibration/NavigatorVibration.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/Page.cpp
diff --git a/Source/core/page/Page.cpp b/Source/core/page/Page.cpp
index a022a6b8d2e483a3af6734474e96ac0bd1d7275b..7f3c39367788fea3a812c05568c02e7df6b0cb24 100644
--- a/Source/core/page/Page.cpp
+++ b/Source/core/page/Page.cpp
@@ -44,6 +44,7 @@
#include "core/page/FrameView.h"
#include "core/page/PageConsole.h"
#include "core/page/PageGroup.h"
+#include "core/page/PageLifecycleNotifier.h"
#include "core/page/PointerLockController.h"
#include "core/page/Settings.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
@@ -625,6 +626,9 @@ void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
else
setTimerAlignmentInterval(DOMTimer::visiblePageAlignmentInterval());
+ if (!isInitialState)
+ lifecycleNotifier()->notifyPageVisibilityChanged();
+
if (!isInitialState && m_mainFrame)
m_mainFrame->dispatchVisibilityStateChangeEvent();
}
@@ -783,6 +787,16 @@ void Page::multisamplingChanged()
(*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled());
}
+PageLifecycleNotifier* Page::lifecycleNotifier()
+{
+ return static_cast<PageLifecycleNotifier*>(LifecycleContext::lifecycleNotifier());
+}
+
+PassOwnPtr<LifecycleNotifier> Page::createLifecycleNotifier()
+{
+ return PageLifecycleNotifier::create(this);
+}
+
Page::PageClients::PageClients()
: chromeClient(0)
, contextMenuClient(0)
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/modules/vibration/NavigatorVibration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698