| 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 ControlTypes().Has(model_type); |
| 231 } |
| 232 |
| 233 ModelTypeSet ControlTypes() { |
| 234 ModelTypeSet set; |
| 235 set.Put(NIGORI); |
| 236 return set; |
| 237 } |
| 238 |
| 239 ModelTypeSet EarlyDownloadTypes() { |
| 240 ModelTypeSet set; |
| 241 set.Put(NIGORI); |
| 242 return set; |
| 243 } |
| 244 |
| 229 const char* ModelTypeToString(ModelType model_type) { | 245 const char* ModelTypeToString(ModelType model_type) { |
| 230 // This is used in serialization routines as well as for displaying debug | 246 // 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 | 247 // information. Do not attempt to change these string values unless you know |
| 232 // what you're doing. | 248 // what you're doing. |
| 233 switch (model_type) { | 249 switch (model_type) { |
| 234 case TOP_LEVEL_FOLDER: | 250 case TOP_LEVEL_FOLDER: |
| 235 return "Top Level Folder"; | 251 return "Top Level Folder"; |
| 236 case UNSPECIFIED: | 252 case UNSPECIFIED: |
| 237 return "Unspecified"; | 253 return "Unspecified"; |
| 238 case BOOKMARKS: | 254 case BOOKMARKS: |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 *model_type = UNSPECIFIED; | 547 *model_type = UNSPECIFIED; |
| 532 return false; | 548 return false; |
| 533 } | 549 } |
| 534 } | 550 } |
| 535 | 551 |
| 536 bool IsRealDataType(ModelType model_type) { | 552 bool IsRealDataType(ModelType model_type) { |
| 537 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; | 553 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; |
| 538 } | 554 } |
| 539 | 555 |
| 540 } // namespace syncer | 556 } // namespace syncer |
| OLD | NEW |