| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ServiceWorkerWindowClient_h | 5 #ifndef ServiceWorkerWindowClient_h |
| 6 #define ServiceWorkerWindowClient_h | 6 #define ServiceWorkerWindowClient_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "modules/serviceworkers/ServiceWorkerClient.h" | 9 #include "modules/serviceworkers/ServiceWorkerClient.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class ScriptState; | 15 class ScriptState; |
| 16 | 16 |
| 17 class ServiceWorkerWindowClient final : public ServiceWorkerClient { | 17 class ServiceWorkerWindowClient final : public ServiceWorkerClient { |
| 18 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
| 19 public: | 19 public: |
| 20 static ServiceWorkerWindowClient* create(const WebServiceWorkerClientInfo&); | 20 static ServiceWorkerWindowClient* create(const WebServiceWorkerClientInfo&); |
| 21 ~ServiceWorkerWindowClient() override; | 21 ~ServiceWorkerWindowClient() override; |
| 22 | 22 |
| 23 // WindowClient.idl | 23 // WindowClient.idl |
| 24 String visibilityState() const { return m_visibilityState; } | 24 String visibilityState() const; |
| 25 bool focused() const { return m_isFocused; } | 25 bool focused() const { return m_isFocused; } |
| 26 String frameType() const; | 26 String frameType() const; |
| 27 ScriptPromise focus(ScriptState*); | 27 ScriptPromise focus(ScriptState*); |
| 28 | 28 |
| 29 virtual void trace(Visitor*) override; | 29 virtual void trace(Visitor*) override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 explicit ServiceWorkerWindowClient(const WebServiceWorkerClientInfo&); | 32 explicit ServiceWorkerWindowClient(const WebServiceWorkerClientInfo&); |
| 33 | 33 |
| 34 // FIXME: remove m_visibilityState when m_pageVisibilityState will be used |
| 35 // by Chromium. |
| 34 String m_visibilityState; | 36 String m_visibilityState; |
| 37 WebPageVisibilityState m_pageVisibilityState; |
| 35 bool m_isFocused; | 38 bool m_isFocused; |
| 36 WebURLRequest::FrameType m_frameType; | 39 WebURLRequest::FrameType m_frameType; |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 } // namespace blink | 42 } // namespace blink |
| 40 | 43 |
| 41 #endif // ServiceWorkerWindowClient_h | 44 #endif // ServiceWorkerWindowClient_h |
| OLD | NEW |