| 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 "google_apis/gcm/engine/account_mapping.h" | 5 #include "google_apis/gcm/engine/account_mapping.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 std::string StatusToString(AccountMapping::MappingStatus status) { | 30 std::string StatusToString(AccountMapping::MappingStatus status) { |
| 31 switch (status) { | 31 switch (status) { |
| 32 case AccountMapping::NEW: | 32 case AccountMapping::NEW: |
| 33 return kStatusNew; | 33 return kStatusNew; |
| 34 case AccountMapping::ADDING: | 34 case AccountMapping::ADDING: |
| 35 return kStatusAdding; | 35 return kStatusAdding; |
| 36 case AccountMapping::MAPPED: | 36 case AccountMapping::MAPPED: |
| 37 return kStatusMapped; | 37 return kStatusMapped; |
| 38 case AccountMapping::REMOVING: | 38 case AccountMapping::REMOVING: |
| 39 return kStatusRemoving; | 39 return kStatusRemoving; |
| 40 default: | |
| 41 NOTREACHED(); | |
| 42 } | 40 } |
| 41 NOTREACHED(); |
| 43 return std::string(); | 42 return std::string(); |
| 44 } | 43 } |
| 45 | 44 |
| 46 bool StringToStatus(const std::string& status_str, | 45 bool StringToStatus(const std::string& status_str, |
| 47 AccountMapping::MappingStatus* status) { | 46 AccountMapping::MappingStatus* status) { |
| 48 if (status_str.compare(kStatusAdding) == 0) | 47 if (status_str.compare(kStatusAdding) == 0) |
| 49 *status = AccountMapping::ADDING; | 48 *status = AccountMapping::ADDING; |
| 50 else if (status_str.compare(kStatusMapped) == 0) | 49 else if (status_str.compare(kStatusMapped) == 0) |
| 51 *status = AccountMapping::MAPPED; | 50 *status = AccountMapping::MAPPED; |
| 52 else if (status_str.compare(kStatusRemoving) == 0) | 51 else if (status_str.compare(kStatusRemoving) == 0) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 121 |
| 123 if (values.size() == kSizeWithMessage) | 122 if (values.size() == kSizeWithMessage) |
| 124 last_message_id = values[kMessageIdIndex]; | 123 last_message_id = values[kMessageIdIndex]; |
| 125 else | 124 else |
| 126 last_message_id.clear(); | 125 last_message_id.clear(); |
| 127 | 126 |
| 128 return true; | 127 return true; |
| 129 } | 128 } |
| 130 | 129 |
| 131 } // namespace gcm | 130 } // namespace gcm |
| OLD | NEW |