| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sync/syncable/model_type.h" | 5 #include "chrome/browser/sync/syncable/model_type.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "chrome/browser/sync/engine/syncproto.h" | 10 #include "chrome/browser/sync/engine/syncproto.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 case EXTENSIONS: | 148 case EXTENSIONS: |
| 149 return "Extensions"; | 149 return "Extensions"; |
| 150 case NIGORI: | 150 case NIGORI: |
| 151 return "Encryption keys"; | 151 return "Encryption keys"; |
| 152 case SESSIONS: | 152 case SESSIONS: |
| 153 return "Sessions"; | 153 return "Sessions"; |
| 154 case APPS: | 154 case APPS: |
| 155 return "Apps"; | 155 return "Apps"; |
| 156 case AUTOFILL_PROFILE: | 156 case AUTOFILL_PROFILE: |
| 157 return "Autofill Profile"; | 157 return "Autofill Profile"; |
| 158 default: |
| 158 break; | 159 break; |
| 159 default: | |
| 160 NOTREACHED() << "No known extension for model type."; | |
| 161 return "INVALID"; | |
| 162 } | 160 } |
| 161 NOTREACHED() << "No known extension for model type."; |
| 162 return "INVALID"; |
| 163 } | 163 } |
| 164 | 164 |
| 165 ModelType ModelTypeFromString(const std::string& model_type_string) { | 165 ModelType ModelTypeFromString(const std::string& model_type_string) { |
| 166 if (model_type_string == "Bookmarks") | 166 if (model_type_string == "Bookmarks") |
| 167 return BOOKMARKS; | 167 return BOOKMARKS; |
| 168 else if (model_type_string == "Preferences") | 168 else if (model_type_string == "Preferences") |
| 169 return PREFERENCES; | 169 return PREFERENCES; |
| 170 else if (model_type_string == "Passwords") | 170 else if (model_type_string == "Passwords") |
| 171 return PASSWORDS; | 171 return PASSWORDS; |
| 172 else if (model_type_string == "Autofill") | 172 else if (model_type_string == "Autofill") |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // server-issued notifications. Remove this when it's not needed | 368 // server-issued notifications. Remove this when it's not needed |
| 369 // anymore. | 369 // anymore. |
| 370 *model_type = UNSPECIFIED; | 370 *model_type = UNSPECIFIED; |
| 371 return true; | 371 return true; |
| 372 } | 372 } |
| 373 *model_type = UNSPECIFIED; | 373 *model_type = UNSPECIFIED; |
| 374 return false; | 374 return false; |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace syncable | 377 } // namespace syncable |
| OLD | NEW |