OLD | NEW |
| (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 CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_TRANSLATIONS_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_TRANSLATIONS_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 #include "base/macros.h" | |
13 #include "components/copresence/proto/enums.pb.h" | |
14 | |
15 namespace copresence { | |
16 class ReportRequest; | |
17 } | |
18 | |
19 namespace extensions { | |
20 | |
21 namespace api { | |
22 namespace copresence { | |
23 struct Operation; | |
24 struct PublishOperation; | |
25 struct SubscribeOperation; | |
26 } | |
27 } | |
28 | |
29 // A 1-1 map of of which app a subscription id belongs to. | |
30 // Key = subscription, value = app_id. | |
31 typedef std::map<std::string, std::string> SubscriptionToAppMap; | |
32 | |
33 // Returns report request protocol buffer containing all the operations in the | |
34 // given vector. If parsing any of the operations fails, we return false. | |
35 bool PrepareReportRequestProto( | |
36 const std::vector<api::copresence::Operation>& operations, | |
37 const std::string& app_id, | |
38 SubscriptionToAppMap* apps_by_subscription_id, | |
39 copresence::ReportRequest* request); | |
40 | |
41 } // namespace extensions | |
42 | |
43 #endif // CHROME_BROWSER_EXTENSIONS_API_COPRESENCE_COPRESENCE_TRANSLATIONS_H_ | |
OLD | NEW |