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

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

Issue 704923002: Add polling and audio check to copresence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ 5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ 6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 12
13 namespace net { 13 namespace net {
14 class URLRequestContextGetter; 14 class URLRequestContextGetter;
15 } 15 }
16 16
17 namespace copresence { 17 namespace copresence {
18 18
19 class Message; 19 class Message;
20 class WhispernetClient; 20 class WhispernetClient;
21 21
22 enum CopresenceStatus { SUCCESS, FAIL }; 22 // AUDIO_FAIL indicates that we weren't able to hear the audio token that
23 // we were playing.
24 enum CopresenceStatus { SUCCESS, FAIL, AUDIO_FAIL };
23 25
24 // Callback type to send a status. 26 // Callback type to send a status.
25 typedef base::Callback<void(CopresenceStatus)> StatusCallback; 27 typedef base::Callback<void(CopresenceStatus)> StatusCallback;
26 28
27 // A delegate interface for users of Copresence. 29 // A delegate interface for users of Copresence.
28 class CopresenceDelegate { 30 class CopresenceDelegate {
29 public: 31 public:
30 virtual ~CopresenceDelegate() {} 32 virtual ~CopresenceDelegate() {}
31 33
32 // This method will be called when we have subscribed messages 34 // This method will be called when we have subscribed messages
33 // that need to be sent to their respective apps. 35 // that need to be sent to their respective apps.
34 virtual void HandleMessages( 36 virtual void HandleMessages(
35 const std::string& app_id, 37 const std::string& app_id,
36 const std::string& subscription_id, 38 const std::string& subscription_id,
37 const std::vector<Message>& message) = 0; 39 const std::vector<Message>& message) = 0;
38 40
41 virtual void HandleStatusUpdate(CopresenceStatus status) = 0;
42
39 // Thw URLRequestContextGetter must outlive the CopresenceManager. 43 // Thw URLRequestContextGetter must outlive the CopresenceManager.
40 virtual net::URLRequestContextGetter* GetRequestContext() const = 0; 44 virtual net::URLRequestContextGetter* GetRequestContext() const = 0;
41 45
42 virtual const std::string GetPlatformVersionString() const = 0; 46 virtual const std::string GetPlatformVersionString() const = 0;
43 47
44 virtual const std::string GetAPIKey(const std::string& app_id) const = 0; 48 virtual const std::string GetAPIKey(const std::string& app_id) const = 0;
45 virtual const std::string GetAuthToken() const = 0; 49 virtual const std::string GetAuthToken() const = 0;
46 50
47 // Thw WhispernetClient must outlive the CopresenceManager. 51 // Thw WhispernetClient must outlive the CopresenceManager.
48 virtual WhispernetClient* GetWhispernetClient() = 0; 52 virtual WhispernetClient* GetWhispernetClient() = 0;
49 }; 53 };
50 54
51 } // namespace copresence 55 } // namespace copresence
52 56
53 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ 57 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698