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