| OLD | NEW |
| 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_impl.h" | 5 #include "components/sync_driver/local_device_info_provider_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/task_runner.h" | 8 #include "base/task_runner.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "components/sync_driver/sync_util.h" | 10 #include "components/sync_driver/sync_util.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 #else | 67 #else |
| 68 return MakeDesktopUserAgentForSync(channel_); | 68 return MakeDesktopUserAgentForSync(channel_); |
| 69 #endif | 69 #endif |
| 70 } | 70 } |
| 71 | 71 |
| 72 std::string LocalDeviceInfoProviderImpl::GetLocalSyncCacheGUID() const { | 72 std::string LocalDeviceInfoProviderImpl::GetLocalSyncCacheGUID() const { |
| 73 return cache_guid_; | 73 return cache_guid_; |
| 74 } | 74 } |
| 75 | 75 |
| 76 scoped_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> | 76 std::unique_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> |
| 77 LocalDeviceInfoProviderImpl::RegisterOnInitializedCallback( | 77 LocalDeviceInfoProviderImpl::RegisterOnInitializedCallback( |
| 78 const base::Closure& callback) { | 78 const base::Closure& callback) { |
| 79 DCHECK(!local_device_info_.get()); | 79 DCHECK(!local_device_info_.get()); |
| 80 return callback_list_.Add(callback); | 80 return callback_list_.Add(callback); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void LocalDeviceInfoProviderImpl::Initialize( | 83 void LocalDeviceInfoProviderImpl::Initialize( |
| 84 const std::string& cache_guid, | 84 const std::string& cache_guid, |
| 85 const std::string& signin_scoped_device_id, | 85 const std::string& signin_scoped_device_id, |
| 86 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { | 86 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 100 const std::string& session_name) { | 100 const std::string& session_name) { |
| 101 local_device_info_.reset(new sync_driver::DeviceInfo( | 101 local_device_info_.reset(new sync_driver::DeviceInfo( |
| 102 guid, session_name, version_, GetSyncUserAgent(), | 102 guid, session_name, version_, GetSyncUserAgent(), |
| 103 GetLocalDeviceType(is_tablet_), signin_scoped_device_id)); | 103 GetLocalDeviceType(is_tablet_), signin_scoped_device_id)); |
| 104 | 104 |
| 105 // Notify observers. | 105 // Notify observers. |
| 106 callback_list_.Notify(); | 106 callback_list_.Notify(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace browser_sync | 109 } // namespace browser_sync |
| OLD | NEW |