OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_INFO_CLIENT_H_ |
| 6 #define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_INFO_CLIENT_H_ |
| 7 |
| 8 #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/WebServiceWorkerClientsInfo.h" |
| 11 #include "url/gurl.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // This class holds the information related to a service worker window client. |
| 16 // It is the content/ equivalent of WebServiceWorkerClientInfo. |
| 17 // An instance can be created empty or can be filed with the expected |
| 18 // properties. Except for the client_id, it is preferred to use the constructor |
| 19 // to fill the properties. |
| 20 struct ServiceWorkerClientInfo { |
| 21 ServiceWorkerClientInfo(); |
| 22 ServiceWorkerClientInfo(blink::WebPageVisibilityState page_visibility_state, |
| 23 bool is_focused, |
| 24 const GURL& url, |
| 25 RequestContextFrameType frame_type); |
| 26 |
| 27 // Returns whether the instance is empty. |
| 28 bool IsEmpty() const; |
| 29 |
| 30 // Returns whether the instance is valid. A valid instance is not empty and |
| 31 // has a valid client_id. |
| 32 bool IsValid() const; |
| 33 |
| 34 operator blink::WebServiceWorkerClientInfo() const; |
| 35 |
| 36 int client_id; |
| 37 blink::WebPageVisibilityState page_visibility_state; |
| 38 bool is_focused; |
| 39 GURL url; |
| 40 RequestContextFrameType frame_type; |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_INFO_CLIENT_H_ |
OLD | NEW |