| 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 "components/gcm_driver/gcm_client_impl.h" | 5 #include "components/gcm_driver/gcm_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 case GCMClientImpl::INITIAL_DEVICE_CHECKIN: | 1145 case GCMClientImpl::INITIAL_DEVICE_CHECKIN: |
| 1146 return "INITIAL_DEVICE_CHECKIN"; | 1146 return "INITIAL_DEVICE_CHECKIN"; |
| 1147 case GCMClientImpl::READY: | 1147 case GCMClientImpl::READY: |
| 1148 return "READY"; | 1148 return "READY"; |
| 1149 default: | 1149 default: |
| 1150 NOTREACHED(); | 1150 NOTREACHED(); |
| 1151 return std::string(); | 1151 return std::string(); |
| 1152 } | 1152 } |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 void GCMClientImpl::RecordDecryptionFailure( |
| 1156 const std::string& app_id, |
| 1157 GCMEncryptionProvider::DecryptionFailure reason) { |
| 1158 recorder_.RecordDecryptionFailure(app_id, reason); |
| 1159 } |
| 1160 |
| 1155 void GCMClientImpl::SetRecording(bool recording) { | 1161 void GCMClientImpl::SetRecording(bool recording) { |
| 1156 recorder_.set_is_recording(recording); | 1162 recorder_.set_is_recording(recording); |
| 1157 } | 1163 } |
| 1158 | 1164 |
| 1159 void GCMClientImpl::ClearActivityLogs() { | 1165 void GCMClientImpl::ClearActivityLogs() { |
| 1160 recorder_.Clear(); | 1166 recorder_.Clear(); |
| 1161 } | 1167 } |
| 1162 | 1168 |
| 1163 GCMClient::GCMStatistics GCMClientImpl::GetStatistics() const { | 1169 GCMClient::GCMStatistics GCMClientImpl::GetStatistics() const { |
| 1164 GCMClient::GCMStatistics stats; | 1170 GCMClient::GCMStatistics stats; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 bool GCMClientImpl::HasStandaloneRegisteredApp() const { | 1378 bool GCMClientImpl::HasStandaloneRegisteredApp() const { |
| 1373 if (registrations_.empty()) | 1379 if (registrations_.empty()) |
| 1374 return false; | 1380 return false; |
| 1375 // Note that account mapper is not counted as a standalone app since it is | 1381 // Note that account mapper is not counted as a standalone app since it is |
| 1376 // automatically started when other app uses GCM. | 1382 // automatically started when other app uses GCM. |
| 1377 return registrations_.size() > 1 || | 1383 return registrations_.size() > 1 || |
| 1378 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); | 1384 !ExistsGCMRegistrationInMap(registrations_, kGCMAccountMapperAppId); |
| 1379 } | 1385 } |
| 1380 | 1386 |
| 1381 } // namespace gcm | 1387 } // namespace gcm |
| OLD | NEW |