| 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 "components/sync/base/model_type.h" | 5 #include "components/sync/base/model_type.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 return result; | 540 return result; |
| 541 } | 541 } |
| 542 | 542 |
| 543 const char* ModelTypeToString(ModelType model_type) { | 543 const char* ModelTypeToString(ModelType model_type) { |
| 544 // This is used in serialization routines as well as for displaying debug | 544 // This is used in serialization routines as well as for displaying debug |
| 545 // information. Do not attempt to change these string values unless you know | 545 // information. Do not attempt to change these string values unless you know |
| 546 // what you're doing. | 546 // what you're doing. |
| 547 if (model_type >= UNSPECIFIED && model_type < MODEL_TYPE_COUNT) | 547 if (model_type >= UNSPECIFIED && model_type < MODEL_TYPE_COUNT) |
| 548 return kModelTypeInfoMap[model_type].model_type_string; | 548 return kModelTypeInfoMap[model_type].model_type_string; |
| 549 NOTREACHED() << "No known extension for model type."; | 549 NOTREACHED() << "No known extension for model type."; |
| 550 return "INVALID"; | 550 return "Invalid"; |
| 551 } | 551 } |
| 552 | 552 |
| 553 // The normal rules about histograms apply here. Always append to the bottom of | 553 // The normal rules about histograms apply here. Always append to the bottom of |
| 554 // the list, and be careful to not reuse integer values that have already been | 554 // the list, and be careful to not reuse integer values that have already been |
| 555 // assigned. | 555 // assigned. |
| 556 // | 556 // |
| 557 // Don't forget to update the "SyncModelTypes" enum in histograms.xml when you | 557 // Don't forget to update the "SyncModelTypes" enum in histograms.xml when you |
| 558 // make changes to this list. | 558 // make changes to this list. |
| 559 int ModelTypeToHistogramInt(ModelType model_type) { | 559 int ModelTypeToHistogramInt(ModelType model_type) { |
| 560 if (model_type >= UNSPECIFIED && model_type < MODEL_TYPE_COUNT) | 560 if (model_type >= UNSPECIFIED && model_type < MODEL_TYPE_COUNT) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 bool TypeSupportsHierarchy(ModelType model_type) { | 725 bool TypeSupportsHierarchy(ModelType model_type) { |
| 726 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER? | 726 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER? |
| 727 return model_type == BOOKMARKS; | 727 return model_type == BOOKMARKS; |
| 728 } | 728 } |
| 729 | 729 |
| 730 bool TypeSupportsOrdering(ModelType model_type) { | 730 bool TypeSupportsOrdering(ModelType model_type) { |
| 731 return model_type == BOOKMARKS; | 731 return model_type == BOOKMARKS; |
| 732 } | 732 } |
| 733 | 733 |
| 734 } // namespace syncer | 734 } // namespace syncer |
| OLD | NEW |