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

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

Issue 2250753002: arc: Fix ArcPackageSyncableService initialization issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
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_sync_data_type_controller.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc b/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0fb112ff4b665cb6f54593f23d26223afe7ec103
--- /dev/null
+++ b/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
+#include "components/arc/common/app.mojom.h"
+#include "components/arc/instance_holder.h"
+#include "content/public/browser/browser_thread.h"
+
+ArcPackageSyncDataTypeController::ArcPackageSyncDataTypeController(
+ syncer::ModelType type,
+ const base::Closure& error_callback,
+ sync_driver::SyncClient* sync_client,
+ Profile* profile)
+ : sync_driver::UIDataTypeController(
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::UI),
+ error_callback,
+ type,
+ sync_client),
+ profile_(profile) {}
+
+ArcPackageSyncDataTypeController::~ArcPackageSyncDataTypeController() {}
+
+bool ArcPackageSyncDataTypeController::ReadyForStart() const {
+ ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_);
+ if (prefs && prefs->app_instance_holder()->instance())
+ return true;
+ return false;
+}

Powered by Google App Engine
This is Rietveld 408576698