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

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

Issue 2277593002: arc: Enable user control for Arc package sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix componets unit_tests 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
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
index 96271d2d244132d1bf46f4e3e4c6937a8bf86756..aae7f03f610248441ab7d551b853897deaccff90 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -585,9 +585,6 @@ void ArcAppListPrefs::OnInstanceReady() {
app_instance->Init(binding_.CreateInterfacePtrAndBind());
app_instance->RefreshAppList();
-
- // Start ArcPackageSyncService.
- sync_service_->SyncStarted();
}
void ArcAppListPrefs::OnInstanceClosed() {
@@ -989,6 +986,13 @@ void ArcAppListPrefs::OnPackageListRefreshed(
if (!current_packages.count(package_name))
RemovePackageFromPrefs(prefs_, package_name);
}
+
+ // Start ArcPackageSyncService ASAP. This is the call_back of
+ // app_instance->RefreshAppList() in OnInstanceReady(). SyncStarted() should
+ // only be called after packagelist refresh is completed. SyncStarted() is
+ // no-op after first time setup or if sync is disabled.
+ DCHECK(sync_service_);
+ sync_service_->SyncStarted();
}
std::vector<std::string> ArcAppListPrefs::GetPackagesFromPrefs() const {
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698