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

Side by Side Diff: components/sync_driver/local_device_info_provider_mock.cc

Issue 1408123003: [Sync] Initial USS service implementation for DeviceInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated for Stan's comments. Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « components/sync_driver/local_device_info_provider_mock.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync_driver/local_device_info_provider_mock.h" 5 #include "components/sync_driver/local_device_info_provider_mock.h"
6 6
7 namespace sync_driver { 7 namespace sync_driver {
8 8
9 LocalDeviceInfoProviderMock::LocalDeviceInfoProviderMock() 9 LocalDeviceInfoProviderMock::LocalDeviceInfoProviderMock()
10 : is_initialized_(false) {} 10 : is_initialized_(false) {}
(...skipping 28 matching lines...) Expand all
39 39
40 std::string LocalDeviceInfoProviderMock::GetLocalSyncCacheGUID() const { 40 std::string LocalDeviceInfoProviderMock::GetLocalSyncCacheGUID() const {
41 return local_device_info_.get() ? local_device_info_->guid() : ""; 41 return local_device_info_.get() ? local_device_info_->guid() : "";
42 } 42 }
43 43
44 void LocalDeviceInfoProviderMock::Initialize( 44 void LocalDeviceInfoProviderMock::Initialize(
45 const std::string& cache_guid, const std::string& signin_scoped_device_id) { 45 const std::string& cache_guid, const std::string& signin_scoped_device_id) {
46 // Ignored for the mock provider. 46 // Ignored for the mock provider.
47 } 47 }
48 48
49 void LocalDeviceInfoProviderMock::Initialize(
50 scoped_ptr<DeviceInfo> local_device_info) {
51 local_device_info_.swap(local_device_info);
52 SetInitialized(true);
53 }
54
49 scoped_ptr<LocalDeviceInfoProvider::Subscription> 55 scoped_ptr<LocalDeviceInfoProvider::Subscription>
50 LocalDeviceInfoProviderMock::RegisterOnInitializedCallback( 56 LocalDeviceInfoProviderMock::RegisterOnInitializedCallback(
51 const base::Closure& callback) { 57 const base::Closure& callback) {
52 DCHECK(!is_initialized_); 58 DCHECK(!is_initialized_);
53 return callback_list_.Add(callback); 59 return callback_list_.Add(callback);
54 } 60 }
55 61
56 void LocalDeviceInfoProviderMock::SetInitialized(bool is_initialized) { 62 void LocalDeviceInfoProviderMock::SetInitialized(bool is_initialized) {
57 is_initialized_ = is_initialized; 63 is_initialized_ = is_initialized;
58 if (is_initialized_) { 64 if (is_initialized_) {
59 callback_list_.Notify(); 65 callback_list_.Notify();
60 } 66 }
61 } 67 }
62 68
63 } // namespace sync_driver 69 } // namespace sync_driver
OLDNEW
« no previous file with comments | « components/sync_driver/local_device_info_provider_mock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698