Commit fa48bec9 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Extensions: Remove temporary cleanup code from crbug.com/558299

In the past, there was a bug where some themes incorrectly got synced
into the EXTENSIONS data type, so we added cleanup code to remove the
bad data. That was long ago and all bad data should be long gone now,
so let's get rid of the cleanup code.

Bug: none
Change-Id: I53fcc8ecb208e9fce6565cda70ec57cc960f9b6c
Reviewed-on: https://chromium-review.googlesource.com/1124680Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572255}
parent f6b27bcd
...@@ -1400,10 +1400,6 @@ void ExtensionService::OnExtensionInstalled( ...@@ -1400,10 +1400,6 @@ void ExtensionService::OnExtensionInstalled(
pending_extension_manager()->GetById(id); pending_extension_manager()->GetById(id);
if (pending_extension_info) { if (pending_extension_info) {
if (!pending_extension_info->ShouldAllowInstall(extension)) { if (!pending_extension_info->ShouldAllowInstall(extension)) {
// Hack for crbug.com/558299, see comment on DeleteThemeDoNotUse.
if (extension->is_theme() && pending_extension_info->is_from_sync())
ExtensionSyncService::Get(profile_)->DeleteThemeDoNotUse(*extension);
pending_extension_manager()->Remove(id); pending_extension_manager()->Remove(id);
LOG(WARNING) << "ShouldAllowInstall() returned false for " << id LOG(WARNING) << "ShouldAllowInstall() returned false for " << id
......
...@@ -57,11 +57,11 @@ bool IsCorrectSyncType(const Extension& extension, syncer::ModelType type) { ...@@ -57,11 +57,11 @@ bool IsCorrectSyncType(const Extension& extension, syncer::ModelType type) {
} }
// Predicate for PendingExtensionManager. // Predicate for PendingExtensionManager.
// TODO(treib,devlin): The !is_theme check shouldn't be necessary anymore after
// all the bad data from crbug.com/558299 has been cleaned up, after M52 or so.
bool ShouldAllowInstall(const Extension* extension) { bool ShouldAllowInstall(const Extension* extension) {
return !extension->is_theme() && // Note: In the past, there was a bug where some themes incorrectly ended up
extensions::sync_helper::IsSyncable(extension); // here, see https://crbug.com/558299. Make sure that doesn't happen anymore.
CHECK(!extension->is_theme());
return extensions::sync_helper::IsSyncable(extension);
} }
syncer::SyncDataList ToSyncerSyncDataList( syncer::SyncDataList ToSyncerSyncDataList(
...@@ -493,11 +493,8 @@ void ExtensionSyncService::ApplySyncData( ...@@ -493,11 +493,8 @@ void ExtensionSyncService::ApplySyncData(
check_for_updates = true; check_for_updates = true;
} else if (state == NOT_INSTALLED) { } else if (state == NOT_INSTALLED) {
if (!extension_service()->pending_extension_manager()->AddFromSync( if (!extension_service()->pending_extension_manager()->AddFromSync(
id, id, extension_sync_data.update_url(), extension_sync_data.version(),
extension_sync_data.update_url(), ShouldAllowInstall, extension_sync_data.remote_install())) {
extension_sync_data.version(),
ShouldAllowInstall,
extension_sync_data.remote_install())) {
LOG(WARNING) << "Could not add pending extension for " << id; LOG(WARNING) << "Could not add pending extension for " << id;
// This means that the extension is already pending installation, with a // This means that the extension is already pending installation, with a
// non-INTERNAL location. Add to pending_sync_data, even though it will // non-INTERNAL location. Add to pending_sync_data, even though it will
...@@ -563,12 +560,6 @@ void ExtensionSyncService::SetSyncStartFlareForTesting( ...@@ -563,12 +560,6 @@ void ExtensionSyncService::SetSyncStartFlareForTesting(
flare_ = flare; flare_ = flare;
} }
void ExtensionSyncService::DeleteThemeDoNotUse(const Extension& theme) {
DCHECK(theme.is_theme());
GetSyncBundle(syncer::EXTENSIONS)->PushSyncDeletion(
theme.id(), CreateSyncData(theme).GetSyncData());
}
extensions::ExtensionService* ExtensionSyncService::extension_service() const { extensions::ExtensionService* ExtensionSyncService::extension_service() const {
return ExtensionSystem::Get(profile_)->extension_service(); return ExtensionSystem::Get(profile_)->extension_service();
} }
......
...@@ -67,12 +67,6 @@ class ExtensionSyncService : public syncer::SyncableService, ...@@ -67,12 +67,6 @@ class ExtensionSyncService : public syncer::SyncableService,
void SetSyncStartFlareForTesting( void SetSyncStartFlareForTesting(
const syncer::SyncableService::StartSyncFlare& flare); const syncer::SyncableService::StartSyncFlare& flare);
// Special hack: There was a bug where themes incorrectly ended up in the
// syncer::EXTENSIONS type. This is for cleaning up the data. crbug.com/558299
// DO NOT USE FOR ANYTHING ELSE!
// TODO(treib,devlin): Remove this after M52 or so.
void DeleteThemeDoNotUse(const extensions::Extension& theme);
private: private:
FRIEND_TEST_ALL_PREFIXES(TwoClientAppsSyncTest, UnexpectedLaunchType); FRIEND_TEST_ALL_PREFIXES(TwoClientAppsSyncTest, UnexpectedLaunchType);
FRIEND_TEST_ALL_PREFIXES(ExtensionDisabledGlobalErrorTest, FRIEND_TEST_ALL_PREFIXES(ExtensionDisabledGlobalErrorTest,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment