Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / local_device_info_provider_mock.h
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_MOCK_H_
6 #define CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_MOCK_H_
7
8 #include "components/sync_driver/device_info.h"
9 #include "components/sync_driver/local_device_info_provider.h"
10
11 namespace browser_sync {
12
13 class LocalDeviceInfoProviderMock
14     : public sync_driver::LocalDeviceInfoProvider {
15  public:
16   // Creates uninitialized provider.
17   LocalDeviceInfoProviderMock();
18   // Creates initialized provider with the specified device info.
19   LocalDeviceInfoProviderMock(
20       const std::string& guid,
21       const std::string& client_name,
22       const std::string& chrome_version,
23       const std::string& sync_user_agent,
24       const sync_pb::SyncEnums::DeviceType device_type,
25       const std::string& signin_scoped_device_id);
26   virtual ~LocalDeviceInfoProviderMock();
27
28   virtual const sync_driver::DeviceInfo* GetLocalDeviceInfo() const OVERRIDE;
29   virtual std::string GetLocalSyncCacheGUID() const OVERRIDE;
30   virtual void Initialize(
31       const std::string& cache_guid,
32       const std::string& signin_scoped_device_id) OVERRIDE;
33   virtual scoped_ptr<Subscription> RegisterOnInitializedCallback(
34     const base::Closure& callback) OVERRIDE;
35
36   void SetInitialized(bool is_initialized);
37
38  private:
39   bool is_initialized_;
40
41   scoped_ptr<sync_driver::DeviceInfo> local_device_info_;
42   base::CallbackList<void(void)> callback_list_;
43 };
44
45 }  // namespace browser_sync
46
47 #endif  // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_MOCK_H_