Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: components/copresence/public/copresence_delegate.h

Issue 2130803002: Deleting the copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback_forward.h"
12
13 namespace gcm {
14 class GCMDriver;
15 }
16
17 namespace net {
18 class URLRequestContextGetter;
19 }
20
21 namespace audio_modem {
22 class WhispernetClient;
23 }
24
25 namespace copresence {
26
27 class Message;
28
29 // AUDIO_FAIL indicates that we weren't able to hear the audio token that
30 // we were playing.
31 enum CopresenceStatus { SUCCESS, FAIL, AUDIO_FAIL };
32
33 // Callback type to send a status.
34 using StatusCallback = base::Callback<void(CopresenceStatus)>;
35
36 // A delegate interface for users of Copresence.
37 class CopresenceDelegate {
38 public:
39 // This method will be called when we have subscribed messages
40 // that need to be sent to their respective apps.
41 virtual void HandleMessages(
42 const std::string& app_id,
43 const std::string& subscription_id,
44 const std::vector<Message>& messages) = 0;
45
46 virtual void HandleStatusUpdate(CopresenceStatus status) = 0;
47
48 // Thw URLRequestContextGetter must outlive the CopresenceManager.
49 virtual net::URLRequestContextGetter* GetRequestContext() const = 0;
50
51 virtual std::string GetPlatformVersionString() const = 0;
52
53 virtual std::string GetAPIKey(const std::string& app_id) const = 0;
54
55 // The WhispernetClient must outlive the CopresenceManager.
56 virtual audio_modem::WhispernetClient* GetWhispernetClient() = 0;
57
58 // Clients may optionally provide a GCMDriver to receive messages from.
59 // If no driver is available, this can return null.
60 virtual gcm::GCMDriver* GetGCMDriver() = 0;
61
62 // Get the copresence device ID for authenticated or anonymous calls,
63 // as specified. If none exists, return the empty string.
64 virtual std::string GetDeviceId(bool authenticated) = 0;
65
66 // Save a copresence device ID for authenticated or anonymous calls.
67 // If the device ID is empty, any stored ID should be deleted.
68 virtual void SaveDeviceId(bool authenticated,
69 const std::string& device_id) = 0;
70
71 protected:
72 virtual ~CopresenceDelegate() {}
73 };
74
75 } // namespace copresence
76
77 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/copresence/public/copresence_constants.h ('k') | components/copresence/public/copresence_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698