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

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

Issue 1397913002: [Sync] Componentize local_device_info_provider_impl and test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android 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
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 24 matching lines...) Expand all
35 35
36 std::string LocalDeviceInfoProviderMock::GetSyncUserAgent() const { 36 std::string LocalDeviceInfoProviderMock::GetSyncUserAgent() const {
37 return "useragent"; 37 return "useragent";
38 } 38 }
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,
46 const std::string& signin_scoped_device_id,
47 const scoped_refptr<base::TaskRunner>& blocking_task_runner) {
46 // Ignored for the mock provider. 48 // Ignored for the mock provider.
47 } 49 }
48 50
49 scoped_ptr<LocalDeviceInfoProvider::Subscription> 51 scoped_ptr<LocalDeviceInfoProvider::Subscription>
50 LocalDeviceInfoProviderMock::RegisterOnInitializedCallback( 52 LocalDeviceInfoProviderMock::RegisterOnInitializedCallback(
51 const base::Closure& callback) { 53 const base::Closure& callback) {
52 DCHECK(!is_initialized_); 54 DCHECK(!is_initialized_);
53 return callback_list_.Add(callback); 55 return callback_list_.Add(callback);
54 } 56 }
55 57
56 void LocalDeviceInfoProviderMock::SetInitialized(bool is_initialized) { 58 void LocalDeviceInfoProviderMock::SetInitialized(bool is_initialized) {
57 is_initialized_ = is_initialized; 59 is_initialized_ = is_initialized;
58 if (is_initialized_) { 60 if (is_initialized_) {
59 callback_list_.Notify(); 61 callback_list_.Notify();
60 } 62 }
61 } 63 }
62 64
63 } // namespace sync_driver 65 } // namespace sync_driver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698