OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ | 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ |
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ | 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ |
7 | 7 |
| 8 #include "content/common/content_export.h" |
8 #include "content/public/common/request_context_frame_type.h" | 9 #include "content/public/common/request_context_frame_type.h" |
9 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 10 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
10 #include "third_party/WebKit/public/platform/WebServiceWorkerClientType.h" | 11 #include "third_party/WebKit/public/platform/WebServiceWorkerClientType.h" |
11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 // This class holds the information related to a service worker window client. | 16 // This class holds the information related to a service worker window client. |
16 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo. | 17 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo. |
17 // An instance can be created empty or can be filed with the expected | 18 // An instance can be created empty or can be filed with the expected |
18 // properties. Except for the client_uuid, it is preferred to use the | 19 // properties. Except for the client_uuid, it is preferred to use the |
19 // constructor to fill the properties. | 20 // constructor to fill the properties. |
20 struct ServiceWorkerClientInfo { | 21 struct CONTENT_EXPORT ServiceWorkerClientInfo { |
21 ServiceWorkerClientInfo(); | 22 ServiceWorkerClientInfo(); |
22 ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state, | 23 ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state, |
23 bool is_focused, | 24 bool is_focused, |
24 const GURL& url, | 25 const GURL& url, |
25 RequestContextFrameType frame_type, | 26 RequestContextFrameType frame_type, |
26 blink::WebServiceWorkerClientType client_type); | 27 blink::WebServiceWorkerClientType client_type); |
27 | 28 |
28 // Returns whether the instance is empty. | 29 // Returns whether the instance is empty. |
29 bool IsEmpty() const; | 30 bool IsEmpty() const; |
30 | 31 |
31 // Returns whether the instance is valid. A valid instance is not empty and | 32 // Returns whether the instance is valid. A valid instance is not empty and |
32 // has a valid client_uuid. | 33 // has a valid client_uuid. |
33 bool IsValid() const; | 34 bool IsValid() const; |
34 | 35 |
35 std::string client_uuid; | 36 std::string client_uuid; |
36 blink::WebPageVisibilityState page_visibility_state; | 37 blink::WebPageVisibilityState page_visibility_state; |
37 bool is_focused; | 38 bool is_focused; |
38 GURL url; | 39 GURL url; |
39 RequestContextFrameType frame_type; | 40 RequestContextFrameType frame_type; |
40 blink::WebServiceWorkerClientType client_type; | 41 blink::WebServiceWorkerClientType client_type; |
41 }; | 42 }; |
42 | 43 |
43 } // namespace content | 44 } // namespace content |
44 | 45 |
45 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ | 46 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_ |
OLD | NEW |