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

Unified Diff: sync/android/java/src/org/chromium/sync/notifier/ModelTypeResolverImpl.java

Issue 13109002: [Sync] Move Android enabled types logic into native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: sync/android/java/src/org/chromium/sync/notifier/ModelTypeResolverImpl.java
diff --git a/sync/android/java/src/org/chromium/sync/notifier/ModelTypeResolverImpl.java b/sync/android/java/src/org/chromium/sync/notifier/ModelTypeResolverImpl.java
deleted file mode 100644
index 27a8e6dc540720cb02def973fedd3d596d39d6e9..0000000000000000000000000000000000000000
--- a/sync/android/java/src/org/chromium/sync/notifier/ModelTypeResolverImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.sync.notifier;
-
-import com.google.common.collect.Multimap;
-
-import org.chromium.sync.internal_api.pub.base.ModelType;
-
-import java.util.HashSet;
-import java.util.Set;
-
-class ModelTypeResolverImpl implements ModelTypeResolver {
- @Override
- public Set<ModelType> resolveModelTypes(Set<ModelType> modelTypes) {
- // Create a new set that we will return as a result, and add all original ModelTypes.
- Set<ModelType> typesWithGroups = new HashSet<ModelType>();
- Set<ModelType> modelTypesNonNull =
- modelTypes == null ? new HashSet<ModelType>() : modelTypes;
- typesWithGroups.addAll(modelTypesNonNull);
-
- Multimap<ModelType, ModelType> modelTypeGroups = ModelType.modelTypeGroups();
- // Remove ModelTypes that are specified, that does not have their group ModelType specified.
- for (ModelType modelType : modelTypeGroups.keySet()) {
- if (modelTypesNonNull.contains(modelType)) {
- typesWithGroups.addAll(modelTypeGroups.get(modelType));
- } else {
- typesWithGroups.removeAll(modelTypeGroups.get(modelType));
- }
- }
-
- // Add all control types.
- typesWithGroups.addAll(ModelType.controlTypes());
- return typesWithGroups;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698