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

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

Issue 2410993002: [Merge To M54]:arc: Fix Android App resurrected by sync. (Closed)
Patch Set: Created 4 years, 2 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.h
diff --git a/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h b/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h
index e665d1abdb14fbe671781981a171a0283621b076..78a9d01e1d2bc6af8fd82602019badd84a55adea 100644
--- a/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h
+++ b/chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h
@@ -6,6 +6,8 @@
#define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_PACKAGE_SYNC_DATA_TYPE_CONTROLLER_H_
#include "base/macros.h"
+#include "components/arc/common/app.mojom.h"
+#include "components/arc/instance_holder.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/sync/driver/data_type_controller.h"
#include "components/sync/driver/ui_data_type_controller.h"
@@ -19,23 +21,33 @@ class Profile;
// A UIDataTypeController for arc package sync datatypes, which enables or
// disables these types based on whether ArcAppInstance is ready.
class ArcPackageSyncDataTypeController
- : public sync_driver::UIDataTypeController {
+ : public sync_driver::UIDataTypeController,
+ public arc::InstanceHolder<arc::mojom::AppInstance>::Observer {
public:
ArcPackageSyncDataTypeController(syncer::ModelType type,
const base::Closure& error_callback,
sync_driver::SyncClient* sync_client,
Profile* profile);
+ // UIDataTypeController override:
bool ReadyForStart() const override;
+ bool StartModels() override;
private:
// DataTypeController is RefCounted.
~ArcPackageSyncDataTypeController() override;
- void OnArcAppsSyncPrefChanged();
+ // arc::InstanceHolder<arc::mojom::AppInstance>::Observer:
+ void OnInstanceReady() override;
void OnArcEnabledPrefChanged();
+ void EnableDataType();
+
+ bool ShouldSyncArc() const;
+
+ bool model_normal_start_ = true;
+
Profile* const profile_;
sync_driver::SyncClient* sync_client_;

Powered by Google App Engine
This is Rietveld 408576698