OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/sync/glue/device_info.h" |
| 10 #include "chrome/browser/sync/glue/local_device_info_provider.h" |
| 11 |
| 12 namespace browser_sync { |
| 13 |
| 14 class LocalDeviceInfoProviderImpl : public LocalDeviceInfoProvider { |
| 15 public: |
| 16 LocalDeviceInfoProviderImpl(); |
| 17 virtual ~LocalDeviceInfoProviderImpl(); |
| 18 |
| 19 // LocalDeviceInfoProvider implementation. |
| 20 virtual const DeviceInfo* GetLocalDeviceInfo() const OVERRIDE; |
| 21 virtual std::string GetLocalSyncCacheGUID() const OVERRIDE; |
| 22 virtual void Initialize(const std::string& cache_guid) OVERRIDE; |
| 23 virtual scoped_ptr<Subscription> RegisterOnInitializedCallback( |
| 24 const base::Closure& callback) OVERRIDE; |
| 25 |
| 26 private: |
| 27 void InitializeContinuation(const DeviceInfo& local_info); |
| 28 |
| 29 std::string cache_guid_; |
| 30 scoped_ptr<DeviceInfo> local_device_info_; |
| 31 base::CallbackList<void(void)> callback_list_; |
| 32 base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); |
| 35 }; |
| 36 |
| 37 } // namespace browser_sync |
| 38 |
| 39 #endif // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
OLD | NEW |