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

Unified Diff: components/sync/driver/device_info_data_type_controller.cc

Issue 2250033002: [Sync] Create //components/sync/device_info. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lint on device info files. 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: components/sync/driver/device_info_data_type_controller.cc
diff --git a/components/sync/driver/device_info_data_type_controller.cc b/components/sync/driver/device_info_data_type_controller.cc
deleted file mode 100644
index f42735aec35df0f0c5ace5b458c688233c93abda..0000000000000000000000000000000000000000
--- a/components/sync/driver/device_info_data_type_controller.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 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 "components/sync/driver/device_info_data_type_controller.h"
-
-#include "base/callback.h"
-#include "components/sync/driver/local_device_info_provider.h"
-
-namespace sync_driver {
-
-DeviceInfoDataTypeController::DeviceInfoDataTypeController(
- const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
- const base::Closure& error_callback,
- SyncClient* sync_client,
- LocalDeviceInfoProvider* local_device_info_provider)
- : UIDataTypeController(ui_thread,
- error_callback,
- syncer::DEVICE_INFO,
- sync_client),
- local_device_info_provider_(local_device_info_provider) {}
-
-DeviceInfoDataTypeController::~DeviceInfoDataTypeController() {}
-
-bool DeviceInfoDataTypeController::StartModels() {
- // Start the data type as soon as the local device info gets available.
- if (local_device_info_provider_->GetLocalDeviceInfo()) {
- return true;
- }
-
- subscription_ = local_device_info_provider_->RegisterOnInitializedCallback(
- base::Bind(&DeviceInfoDataTypeController::OnLocalDeviceInfoLoaded, this));
-
- return false;
-}
-
-void DeviceInfoDataTypeController::StopModels() {
- subscription_.reset();
-}
-
-void DeviceInfoDataTypeController::OnLocalDeviceInfoLoaded() {
- DCHECK_EQ(state_, MODEL_STARTING);
- DCHECK(local_device_info_provider_->GetLocalDeviceInfo());
-
- subscription_.reset();
- OnModelLoaded();
-}
-
-} // namespace sync_driver

Powered by Google App Engine
This is Rietveld 408576698