ExtensionSyncService: don't sync themes

Themes are handled by the special ThemeSyncableService.

This CL does two things:
- ExtensionSyncService now ignores themes, i.e. doesn't send out sync changes for them.
- Clean up theme data that ended up in the syncer::EXTENSIONS type.

BUG=558299

Review URL: https://codereview.chromium.org/1492453002

Cr-Commit-Position: refs/heads/master@{#364023}
diff --git a/chrome/browser/extensions/extension_service_sync_unittest.cc b/chrome/browser/extensions/extension_service_sync_unittest.cc
index 1a50b17..d9da886 100644
--- a/chrome/browser/extensions/extension_service_sync_unittest.cc
+++ b/chrome/browser/extensions/extension_service_sync_unittest.cc
@@ -1409,6 +1409,40 @@
   }
 }
 
+// Regression test for crbug.com/558299
+TEST_F(ExtensionServiceSyncTest, DontSyncThemes) {
+  InitializeEmptyExtensionService();
+
+  // The user has enabled sync.
+  ProfileSyncServiceFactory::GetForProfile(profile())->SetSyncSetupCompleted();
+  // Make sure ExtensionSyncService is created, so it'll be notified of changes.
+  extension_sync_service();
+
+  service()->Init();
+  ASSERT_TRUE(service()->is_ready());
+
+  syncer::FakeSyncChangeProcessor* processor =
+      new syncer::FakeSyncChangeProcessor;
+  extension_sync_service()->MergeDataAndStartSyncing(
+      syncer::EXTENSIONS,
+      syncer::SyncDataList(),
+      make_scoped_ptr(processor),
+      make_scoped_ptr(new syncer::SyncErrorFactoryMock));
+
+  processor->changes().clear();
+
+  // Sanity check: Installing an extension should result in a sync change.
+  InstallCRX(data_dir().AppendASCII("good.crx"), INSTALL_NEW);
+  EXPECT_EQ(1u, processor->changes().size());
+
+  processor->changes().clear();
+
+  // Installing a theme should not result in a sync change (themes are handled
+  // separately by ThemeSyncableService).
+  InstallCRX(data_dir().AppendASCII("theme.crx"), INSTALL_NEW);
+  EXPECT_TRUE(processor->changes().empty());
+}
+
 #if defined(ENABLE_SUPERVISED_USERS)
 
 class ExtensionServiceTestSupervised : public ExtensionServiceSyncTest,