Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: components/sync/syncable/model_type.cc

Issue 2916133002: [Sync] Support commit only types. (Closed)
Patch Set: Rebase again. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 ModelTypeSet PriorityCoreTypes() { 534 ModelTypeSet PriorityCoreTypes() {
535 ModelTypeSet result = ControlTypes(); 535 ModelTypeSet result = ControlTypes();
536 536
537 // The following are non-control core types. 537 // The following are non-control core types.
538 result.Put(SUPERVISED_USERS); 538 result.Put(SUPERVISED_USERS);
539 result.Put(SUPERVISED_USER_SETTINGS); 539 result.Put(SUPERVISED_USER_SETTINGS);
540 540
541 return result; 541 return result;
542 } 542 }
543 543
544 ModelTypeSet CommitOnlyTypes() {
545 return ModelTypeSet(USER_EVENTS);
546 }
547
544 const char* ModelTypeToString(ModelType model_type) { 548 const char* ModelTypeToString(ModelType model_type) {
545 // This is used in serialization routines as well as for displaying debug 549 // This is used in serialization routines as well as for displaying debug
546 // information. Do not attempt to change these string values unless you know 550 // information. Do not attempt to change these string values unless you know
547 // what you're doing. 551 // what you're doing.
548 if (model_type >= UNSPECIFIED && model_type < MODEL_TYPE_COUNT) 552 if (model_type >= UNSPECIFIED && model_type < MODEL_TYPE_COUNT)
549 return kModelTypeInfoMap[model_type].model_type_string; 553 return kModelTypeInfoMap[model_type].model_type_string;
550 NOTREACHED() << "No known extension for model type."; 554 NOTREACHED() << "No known extension for model type.";
551 return "Invalid"; 555 return "Invalid";
552 } 556 }
553 557
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 bool TypeSupportsHierarchy(ModelType model_type) { 730 bool TypeSupportsHierarchy(ModelType model_type) {
727 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER? 731 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER?
728 return model_type == BOOKMARKS; 732 return model_type == BOOKMARKS;
729 } 733 }
730 734
731 bool TypeSupportsOrdering(ModelType model_type) { 735 bool TypeSupportsOrdering(ModelType model_type) {
732 return model_type == BOOKMARKS; 736 return model_type == BOOKMARKS;
733 } 737 }
734 738
735 } // namespace syncer 739 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698