OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "content/common/content_export.h" |
| 12 #include "url/gurl.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // The prefix used for all push messaging application ids. |
| 17 CONTENT_EXPORT extern const char kPushMessagingApplicationIdPrefix[]; |
| 18 |
| 19 // Type used to identify a web app from a Push API perspective. |
| 20 struct CONTENT_EXPORT PushMessagingApplicationId { |
| 21 public: |
| 22 static PushMessagingApplicationId Parse(const std::string& id); |
| 23 |
| 24 PushMessagingApplicationId() |
| 25 : origin(GURL::EmptyGURL()), service_worker_registration_id(-1) {} |
| 26 PushMessagingApplicationId(const GURL& origin, |
| 27 int64 service_worker_registration_id) |
| 28 : origin(origin), |
| 29 service_worker_registration_id(service_worker_registration_id) {} |
| 30 |
| 31 bool IsValid(); |
| 32 std::string ToString(); |
| 33 |
| 34 const GURL origin; |
| 35 const int64 service_worker_registration_id; |
| 36 }; |
| 37 |
| 38 } // namespace content |
| 39 |
| 40 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_APPLICATION_ID_H_ |
OLD | NEW |