| 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 #ifndef CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | 6 #define COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "components/sync_driver/device_info.h" | 9 #include "components/sync_driver/device_info.h" |
| 10 #include "components/sync_driver/local_device_info_provider.h" | 10 #include "components/sync_driver/local_device_info_provider.h" |
| 11 #include "components/version_info/version_info.h" |
| 11 | 12 |
| 12 namespace browser_sync { | 13 namespace browser_sync { |
| 13 | 14 |
| 14 class LocalDeviceInfoProviderImpl | 15 class LocalDeviceInfoProviderImpl |
| 15 : public sync_driver::LocalDeviceInfoProvider { | 16 : public sync_driver::LocalDeviceInfoProvider { |
| 16 public: | 17 public: |
| 17 LocalDeviceInfoProviderImpl(); | 18 LocalDeviceInfoProviderImpl(version_info::Channel channel, |
| 19 const std::string& version); |
| 18 ~LocalDeviceInfoProviderImpl() override; | 20 ~LocalDeviceInfoProviderImpl() override; |
| 19 | 21 |
| 20 // LocalDeviceInfoProvider implementation. | 22 // LocalDeviceInfoProvider implementation. |
| 21 const sync_driver::DeviceInfo* GetLocalDeviceInfo() const override; | 23 const sync_driver::DeviceInfo* GetLocalDeviceInfo() const override; |
| 22 std::string GetSyncUserAgent() const override; | 24 std::string GetSyncUserAgent() const override; |
| 23 std::string GetLocalSyncCacheGUID() const override; | 25 std::string GetLocalSyncCacheGUID() const override; |
| 24 void Initialize(const std::string& cache_guid, | 26 void Initialize( |
| 25 const std::string& signin_scoped_device_id) override; | 27 const std::string& cache_guid, |
| 28 const std::string& signin_scoped_device_id, |
| 29 const scoped_refptr<base::TaskRunner>& blocking_task_runner) override; |
| 26 scoped_ptr<Subscription> RegisterOnInitializedCallback( | 30 scoped_ptr<Subscription> RegisterOnInitializedCallback( |
| 27 const base::Closure& callback) override; | 31 const base::Closure& callback) override; |
| 28 | 32 |
| 29 private: | 33 private: |
| 30 | |
| 31 void InitializeContinuation(const std::string& guid, | 34 void InitializeContinuation(const std::string& guid, |
| 32 const std::string& signin_scoped_device_id, | 35 const std::string& signin_scoped_device_id, |
| 33 const std::string& session_name); | 36 const std::string& session_name); |
| 34 | 37 |
| 38 const version_info::Channel channel_; |
| 39 const std::string version_; |
| 35 std::string cache_guid_; | 40 std::string cache_guid_; |
| 36 scoped_ptr<sync_driver::DeviceInfo> local_device_info_; | 41 scoped_ptr<sync_driver::DeviceInfo> local_device_info_; |
| 37 base::CallbackList<void(void)> callback_list_; | 42 base::CallbackList<void(void)> callback_list_; |
| 38 base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; | 43 base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; |
| 39 | 44 |
| 40 DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); | 45 DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 } // namespace browser_sync | 48 } // namespace browser_sync |
| 44 | 49 |
| 45 #endif // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | 50 #endif // COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| OLD | NEW |