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

Unified Diff: chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc

Issue 2247523002: arc: Fix ArcPackageSyncableService initialization issue. ArcPackageSyncableService should not be st… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2824
Patch Set: Created 4 years, 4 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/ui/app_list/arc/arc_package_syncable_service.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
index 5e196ce172a480bdcb1e3d0fbc3a2323e6a72713..0972718670e5a14dd2ee3718c177d307659eb447 100644
--- a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
+++ b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
@@ -7,6 +7,7 @@
#include <unordered_set>
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_package_syncable_service_factory.h"
#include "chrome/common/pref_names.h"
@@ -15,6 +16,7 @@
#include "components/sync/api/sync_data.h"
#include "components/sync/api/sync_merge_result.h"
#include "components/sync/protocol/sync.pb.h"
+#include "components/sync_driver/sync_service.h"
namespace arc {
@@ -165,6 +167,7 @@ void ArcPackageSyncableService::StopSyncing(syncer::ModelType type) {
sync_processor_.reset();
sync_error_handler_.reset();
+ flare_.Reset();
sync_items_.clear();
pending_install_items_.clear();
@@ -215,6 +218,12 @@ syncer::SyncError ArcPackageSyncableService::ProcessSyncChanges(
bool ArcPackageSyncableService::SyncStarted() {
if (sync_processor_.get())
return true;
+
+ sync_driver::SyncService* sync_service =
+ ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_);
+ if (sync_service)
+ sync_service->ReenableDatatype(syncer::ARC_PACKAGE);
+
if (flare_.is_null()) {
VLOG(2) << this << ": SyncStarted: Flare.";
flare_ = sync_start_util::GetFlareForSyncableService(profile_->GetPath());
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698