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
3 // found in the LICENSE file.
5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_
6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_
8 #include "base/time/time.h"
9 #include "content/public/common/request_context_frame_type.h"
10 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
11 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerClientType.h"
16 // This class holds the information related to a service worker window client.
17 // It is the content/ equivalent of Blink's WebServiceWorkerClientInfo.
18 // An instance can be created empty or can be filed with the expected
19 // properties. Except for the client_uuid, it is preferred to use the
20 // constructor to fill the properties.
21 struct ServiceWorkerClientInfo
{
22 ServiceWorkerClientInfo();
23 ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state
,
26 RequestContextFrameType frame_type
,
27 base::TimeTicks last_focus_time
,
28 blink::WebServiceWorkerClientType client_type
);
30 // Returns whether the instance is empty.
33 // Returns whether the instance is valid. A valid instance is not empty and
34 // has a valid client_uuid.
37 std::string client_uuid
;
38 blink::WebPageVisibilityState page_visibility_state
;
41 RequestContextFrameType frame_type
;
42 blink::WebServiceWorkerClientType client_type
;
43 base::TimeTicks last_focus_time
;
46 } // namespace content
48 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_CLIENT_INFO_H_