Chromium Code Reviews| 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 // Returns sync's representation of the local device info. | |
| 20 // Return value is an empty scoped_ptr if the device info is unavailable. | |
|
maniscalco
2014/07/08 21:17:53
Since these methods are documented in the base cla
stanisc
2014/07/09 21:58:36
Done.
| |
| 21 virtual const DeviceInfo* GetLocalDeviceInfo() const OVERRIDE; | |
| 22 | |
| 23 // Used for creation of the machine tag for this local session. | |
| 24 virtual std::string GetLocalSyncCacheGUID() const OVERRIDE; | |
| 25 | |
| 26 // Specifies whether local device info is available | |
| 27 virtual bool IsInitialized() const OVERRIDE; | |
| 28 | |
| 29 // Registers a callback to be called when local device info becomes available | |
| 30 virtual scoped_ptr<Subscription> RegisterOnInitializedCallback( | |
| 31 const base::Closure& callback) OVERRIDE; | |
| 32 | |
| 33 // Starts initializing local device info | |
| 34 void Initialize(const std::string& cache_guid); | |
| 35 | |
| 36 private: | |
| 37 void InitializeContinuation(const DeviceInfo& local_info); | |
| 38 | |
| 39 std::string cache_guid_; | |
| 40 scoped_ptr<DeviceInfo> local_device_info_; | |
| 41 base::CallbackList<void(void)> callback_list_; | |
| 42 base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); | |
| 45 }; | |
| 46 | |
| 47 } // namespace browser_sync | |
| 48 | |
| 49 #endif // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ | |
| OLD | NEW |