Move Webstore URL concepts to //extensions and out
[chromium-blink-merge.git] / chrome / browser / services / gcm / push_messaging_application_id.h
blob777eaf2debeea764aa010b8ff594608a2ff66d6f
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.
5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "url/gurl.h"
13 namespace gcm {
15 // The prefix used for all push messaging application ids.
16 extern const char kPushMessagingApplicationIdPrefix[];
18 // Type used to identify a web app from a Push API perspective.
19 struct PushMessagingApplicationId {
20 public:
21 static PushMessagingApplicationId Parse(const std::string& id);
23 PushMessagingApplicationId()
24 : origin(GURL::EmptyGURL()), service_worker_registration_id(-1) {}
25 PushMessagingApplicationId(const GURL& origin,
26 int64 service_worker_registration_id)
27 : origin(origin),
28 service_worker_registration_id(service_worker_registration_id) {}
30 bool IsValid();
31 std::string ToString() const;
33 const GURL origin;
34 const int64 service_worker_registration_id;
37 } // namespace gcm
39 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_APPLICATION_ID_H_