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 ScriptPromiseResolver; | |
15 class ScriptState; | 16 class ScriptState; |
16 | 17 |
17 class ServiceWorkerWindowClient final : public ServiceWorkerClient { | 18 class ServiceWorkerWindowClient final : public ServiceWorkerClient { |
18 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
19 public: | 20 public: |
21 // To be used by CallbackPromiseAdapter. | |
22 typedef blink::WebServiceWorkerClientInfo WebType; | |
Michael van Ouwerkerk
2015/01/30 14:56:28
nit: omit namespace
mlamouri (slow - plz ping)
2015/02/02 16:09:26
Done.
| |
23 | |
24 static ServiceWorkerWindowClient* take(ScriptPromiseResolver*, WebType*); | |
25 static void dispose(WebType*); | |
26 | |
20 static ServiceWorkerWindowClient* create(const WebServiceWorkerClientInfo&); | 27 static ServiceWorkerWindowClient* create(const WebServiceWorkerClientInfo&); |
21 ~ServiceWorkerWindowClient() override; | 28 ~ServiceWorkerWindowClient() override; |
22 | 29 |
23 // WindowClient.idl | 30 // WindowClient.idl |
24 String visibilityState() const; | 31 String visibilityState() const; |
25 bool focused() const { return m_isFocused; } | 32 bool focused() const { return m_isFocused; } |
26 String frameType() const; | 33 String frameType() const; |
27 ScriptPromise focus(ScriptState*); | 34 ScriptPromise focus(ScriptState*); |
28 | 35 |
29 virtual void trace(Visitor*) override; | 36 virtual void trace(Visitor*) override; |
30 | 37 |
31 private: | 38 private: |
32 explicit ServiceWorkerWindowClient(const WebServiceWorkerClientInfo&); | 39 explicit ServiceWorkerWindowClient(const WebServiceWorkerClientInfo&); |
33 | 40 |
34 WebPageVisibilityState m_pageVisibilityState; | 41 WebPageVisibilityState m_pageVisibilityState; |
35 bool m_isFocused; | 42 bool m_isFocused; |
36 WebURLRequest::FrameType m_frameType; | 43 WebURLRequest::FrameType m_frameType; |
37 }; | 44 }; |
38 | 45 |
39 } // namespace blink | 46 } // namespace blink |
40 | 47 |
41 #endif // ServiceWorkerWindowClient_h | 48 #endif // ServiceWorkerWindowClient_h |
OLD | NEW |