| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/public/syncable/model_type.h" | 5 #include "sync/internal_api/public/syncable/model_type.h" |
| 6 | 6 |
| 7 #include "base/string_split.h" | 7 #include "base/string_split.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "sync/engine/syncproto.h" | 9 #include "sync/engine/syncproto.h" |
| 10 #include "sync/protocol/app_notification_specifics.pb.h" | 10 #include "sync/protocol/app_notification_specifics.pb.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 if (specifics.has_app_notification()) | 221 if (specifics.has_app_notification()) |
| 222 return APP_NOTIFICATIONS; | 222 return APP_NOTIFICATIONS; |
| 223 | 223 |
| 224 return UNSPECIFIED; | 224 return UNSPECIFIED; |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool ShouldMaintainPosition(ModelType model_type) { | 227 bool ShouldMaintainPosition(ModelType model_type) { |
| 228 return model_type == BOOKMARKS; | 228 return model_type == BOOKMARKS; |
| 229 } | 229 } |
| 230 | 230 |
| 231 bool IsInternalType(ModelType model_type) { |
| 232 return model_type == NIGORI; |
| 233 } |
| 234 |
| 231 const char* ModelTypeToString(ModelType model_type) { | 235 const char* ModelTypeToString(ModelType model_type) { |
| 232 // This is used in serialization routines as well as for displaying debug | 236 // This is used in serialization routines as well as for displaying debug |
| 233 // information. Do not attempt to change these string values unless you know | 237 // information. Do not attempt to change these string values unless you know |
| 234 // what you're doing. | 238 // what you're doing. |
| 235 switch (model_type) { | 239 switch (model_type) { |
| 236 case TOP_LEVEL_FOLDER: | 240 case TOP_LEVEL_FOLDER: |
| 237 return "Top Level Folder"; | 241 return "Top Level Folder"; |
| 238 case UNSPECIFIED: | 242 case UNSPECIFIED: |
| 239 return "Unspecified"; | 243 return "Unspecified"; |
| 240 case BOOKMARKS: | 244 case BOOKMARKS: |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 *model_type = UNSPECIFIED; | 537 *model_type = UNSPECIFIED; |
| 534 return false; | 538 return false; |
| 535 } | 539 } |
| 536 } | 540 } |
| 537 | 541 |
| 538 bool IsRealDataType(ModelType model_type) { | 542 bool IsRealDataType(ModelType model_type) { |
| 539 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; | 543 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; |
| 540 } | 544 } |
| 541 | 545 |
| 542 } // namespace syncable | 546 } // namespace syncable |
| OLD | NEW |