Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / components / copresence / handlers / gcm_handler.h
blob206db819075c6c4bb81f621f17f6e07cddc0fc20
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_
8 #include <string>
10 #include "base/callback_forward.h"
12 namespace gcm {
13 class GCMDriver;
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.
21 class GCMHandler {
22 public:
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&)>;
27 GCMHandler() {}
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;
33 private:
34 DISALLOW_COPY_AND_ASSIGN(GCMHandler);
37 } // namespace copresence
39 #endif // COMPONENTS_COPRESENCE_HANDLERS_GCM_HANDLER_H_