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

Unified Diff: chrome/browser/extensions/extension_sync_service.cc

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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: chrome/browser/extensions/extension_sync_service.cc
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc
index 7dbe61398620e9c4f501402ea160bd4ed24f164f..ef12f1d73ffa6e0e487e52118f6878f9a9a9a1fe 100644
--- a/chrome/browser/extensions/extension_sync_service.cc
+++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -27,6 +27,7 @@
#include "extensions/browser/app_sorting.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_util.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
#include "extensions/common/feature_switch.h"
@@ -57,6 +58,11 @@ void OnWebApplicationInfoLoaded(
CreateOrUpdateBookmarkApp(extension_service.get(), synced_info);
}
+bool CanSyncApp(const Extension* extension, Profile* profile) {
+ return extensions::sync_helper::IsSyncableApp(extension) &&
+ !extensions::util::IsEphemeralApp(extension->id(), profile);
+}
+
} // namespace
ExtensionSyncService::ExtensionSyncService(Profile* profile,
@@ -97,7 +103,7 @@ syncer::SyncChange ExtensionSyncService::PrepareToSyncUninstallExtension(
// "back from the dead" style bugs, because sync will add-back the extension
// that was uninstalled here when MergeDataAndStartSyncing is called.
// See crbug.com/256795.
- if (extensions::sync_helper::IsSyncableApp(extension)) {
+ if (CanSyncApp(extension, profile_)) {
if (app_sync_bundle_.IsSyncing())
return app_sync_bundle_.CreateSyncChangeToDelete(extension);
else if (extensions_ready && !flare_.is_null())
@@ -128,7 +134,7 @@ void ExtensionSyncService::SyncEnableExtension(
const extensions::Extension& extension) {
// Syncing may not have started yet, so handle pending enables.
- if (extensions::sync_helper::IsSyncableApp(&extension))
+ if (CanSyncApp(&extension, profile_))
pending_app_enables_.OnExtensionEnabled(extension.id());
if (extensions::sync_helper::IsSyncableExtension(&extension))
@@ -141,7 +147,7 @@ void ExtensionSyncService::SyncDisableExtension(
const extensions::Extension& extension) {
// Syncing may not have started yet, so handle pending enables.
- if (extensions::sync_helper::IsSyncableApp(&extension))
+ if (CanSyncApp(&extension, profile_))
pending_app_enables_.OnExtensionDisabled(extension.id());
if (extensions::sync_helper::IsSyncableExtension(&extension))
@@ -517,7 +523,7 @@ bool ExtensionSyncService::ProcessExtensionSyncDataHelper(
void ExtensionSyncService::SyncExtensionChangeIfNeeded(
const Extension& extension) {
- if (extensions::sync_helper::IsSyncableApp(&extension)) {
+ if (CanSyncApp(&extension, profile_)) {
if (app_sync_bundle_.IsSyncing())
app_sync_bundle_.SyncChangeIfNeeded(extension);
else if (extension_service_->is_ready() && !flare_.is_null())

Powered by Google App Engine
This is Rietveld 408576698