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 COMPONENTS_COPRESENCE_HANDLERS_GCM_HANDLER_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_GCM_HANDLER_H_
10 #include "base/callback_forward.h"
16 namespace copresence
{
18 // A class to handle GCM messages from the Copresence server. As far as the
19 // rest of the system is concerned, it simply provides the registered GCM ID.
20 // The implementation will call other classes to enact the message contents.
23 // Callback to report that registration has completed.
24 // Returns an empty ID if registration failed.
25 using RegistrationCallback
= base::Callback
<void(const std::string
&)>;
28 virtual ~GCMHandler() {}
30 // Request the GCM ID. It may be returned now or later, via the callback.
31 virtual void GetGcmId(const RegistrationCallback
& callback
) = 0;
34 DISALLOW_COPY_AND_ASSIGN(GCMHandler
);
37 } // namespace copresence
39 #endif // COMPONENTS_COPRESENCE_HANDLERS_GCM_HANDLER_H_