| 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 for (ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) { | 637 for (ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) { |
| 638 value->AppendString(ModelTypeToString(it.Get())); | 638 value->AppendString(ModelTypeToString(it.Get())); |
| 639 } | 639 } |
| 640 return value; | 640 return value; |
| 641 } | 641 } |
| 642 | 642 |
| 643 ModelTypeSet ModelTypeSetFromValue(const base::ListValue& value) { | 643 ModelTypeSet ModelTypeSetFromValue(const base::ListValue& value) { |
| 644 ModelTypeSet result; | 644 ModelTypeSet result; |
| 645 for (base::ListValue::const_iterator i = value.begin(); i != value.end(); | 645 for (base::ListValue::const_iterator i = value.begin(); i != value.end(); |
| 646 ++i) { | 646 ++i) { |
| 647 result.Put(ModelTypeFromValue(**i)); | 647 result.Put(ModelTypeFromValue(*i)); |
| 648 } | 648 } |
| 649 return result; | 649 return result; |
| 650 } | 650 } |
| 651 | 651 |
| 652 // TODO(zea): remove all hardcoded tags in model associators and have them use | 652 // TODO(zea): remove all hardcoded tags in model associators and have them use |
| 653 // this instead. | 653 // this instead. |
| 654 // NOTE: Proxy types should return empty strings (so that we don't NOTREACHED | 654 // NOTE: Proxy types should return empty strings (so that we don't NOTREACHED |
| 655 // in tests when we verify they have no root node). | 655 // in tests when we verify they have no root node). |
| 656 std::string ModelTypeToRootTag(ModelType type) { | 656 std::string ModelTypeToRootTag(ModelType type) { |
| 657 if (IsProxyType(type)) | 657 if (IsProxyType(type)) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 bool TypeSupportsHierarchy(ModelType model_type) { | 716 bool TypeSupportsHierarchy(ModelType model_type) { |
| 717 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER? | 717 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER? |
| 718 return model_type == BOOKMARKS; | 718 return model_type == BOOKMARKS; |
| 719 } | 719 } |
| 720 | 720 |
| 721 bool TypeSupportsOrdering(ModelType model_type) { | 721 bool TypeSupportsOrdering(ModelType model_type) { |
| 722 return model_type == BOOKMARKS; | 722 return model_type == BOOKMARKS; |
| 723 } | 723 } |
| 724 | 724 |
| 725 } // namespace syncer | 725 } // namespace syncer |
| OLD | NEW |