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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp

Issue 844733003: Use VisibilityState enum and move WebPageVisibilityState to public/platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sw_enum_stuff
Patch Set: SWContainer uses pageVisibilityState Created 5 years, 11 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: Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
index 7ec61f6ff32a9318eab6a3f999aa8792d29a0174..e4987e5d74a753773b40e01291657df462d38dc5 100644
--- a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -7,6 +7,7 @@
#include "bindings/core/v8/CallbackPromiseAdapter.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "core/page/PageVisibilityState.h"
#include "core/page/WindowFocusAllowedIndicator.h"
#include "modules/serviceworkers/ServiceWorkerError.h"
#include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
@@ -23,6 +24,7 @@ ServiceWorkerWindowClient* ServiceWorkerWindowClient::create(const WebServiceWor
ServiceWorkerWindowClient::ServiceWorkerWindowClient(const WebServiceWorkerClientInfo& info)
: ServiceWorkerClient(info)
, m_visibilityState(info.visibilityState)
+ , m_pageVisibilityState(info.pageVisibilityState)
, m_isFocused(info.isFocused)
, m_frameType(info.frameType)
{
@@ -32,6 +34,14 @@ ServiceWorkerWindowClient::~ServiceWorkerWindowClient()
{
}
+String ServiceWorkerWindowClient::visibilityState() const
+{
+ // FIXME: temporary until m_pageVisibilityState is used in Chromium.
+ if (m_pageVisibilityState == WebPageVisibilityStateLast)
+ return m_visibilityState;
+ return pageVisibilityStateString(static_cast<PageVisibilityState>(m_pageVisibilityState));
+}
+
String ServiceWorkerWindowClient::frameType() const
{
DEFINE_STATIC_LOCAL(const String, auxiliary, ("auxiliary"));
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerWindowClient.h ('k') | Source/modules/serviceworkers/WindowClient.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698