| OLD | NEW |
| 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 #include "chrome/browser/extensions/api/copresence/copresence_translations.h" | 5 #include "chrome/browser/extensions/api/copresence/copresence_translations.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/api/copresence.h" | 7 #include "chrome/common/extensions/api/copresence.h" |
| 8 #include "components/copresence/proto/data.pb.h" | 8 #include "components/copresence/proto/data.pb.h" |
| 9 #include "components/copresence/proto/enums.pb.h" | 9 #include "components/copresence/proto/enums.pb.h" |
| 10 #include "components/copresence/proto/rpcs.pb.h" | 10 #include "components/copresence/proto/rpcs.pb.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 178 } |
| 179 | 179 |
| 180 request->mutable_manage_subscriptions_request()->add_id_to_unsubscribe( | 180 request->mutable_manage_subscriptions_request()->add_id_to_unsubscribe( |
| 181 subscription_id); | 181 subscription_id); |
| 182 DVLOG(2) << "Cancelling subscription \"" << subscription_id << "\" for app \"" | 182 DVLOG(2) << "Cancelling subscription \"" << subscription_id << "\" for app \"" |
| 183 << app_id << "\""; | 183 << app_id << "\""; |
| 184 return true; | 184 return true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool PrepareReportRequestProto( | 187 bool PrepareReportRequestProto( |
| 188 const std::vector<linked_ptr<Operation> >& operations, | 188 const std::vector<linked_ptr<Operation>>& operations, |
| 189 const std::string& app_id, | 189 const std::string& app_id, |
| 190 SubscriptionToAppMap* apps_by_subscription_id, | 190 SubscriptionToAppMap* apps_by_subscription_id, |
| 191 ReportRequest* request) { | 191 ReportRequest* request) { |
| 192 for (size_t i = 0; i < operations.size(); ++i) { | 192 for (size_t i = 0; i < operations.size(); ++i) { |
| 193 linked_ptr<Operation> op = operations[i]; | 193 linked_ptr<Operation> op = operations[i]; |
| 194 DCHECK(op.get()); | 194 DCHECK(op.get()); |
| 195 | 195 |
| 196 // Verify our object has exactly one operation. | 196 // Verify our object has exactly one operation. |
| 197 if (static_cast<int>(op->publish != NULL) + | 197 if (static_cast<int>(op->publish != NULL) + |
| 198 static_cast<int>(op->subscribe != NULL) + | 198 static_cast<int>(op->subscribe != NULL) + |
| (...skipping 18 matching lines...) Expand all Loading... |
| 217 apps_by_subscription_id, | 217 apps_by_subscription_id, |
| 218 request)) | 218 request)) |
| 219 return false; | 219 return false; |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 return true; | 223 return true; |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace extensions | 226 } // namespace extensions |
| OLD | NEW |