Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / local_discovery / privet_device_lister_impl.h
1 // Copyright 2013 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_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_IMPL_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_IMPL_H_
7
8 #include <string>
9
10 #include "chrome/browser/local_discovery/privet_device_lister.h"
11 #include "chrome/browser/local_discovery/service_discovery_device_lister.h"
12
13 namespace local_discovery {
14
15 class ServiceDiscoveryClient;
16
17 class PrivetDeviceListerImpl : public PrivetDeviceLister,
18                                public ServiceDiscoveryDeviceLister::Delegate {
19  public:
20   PrivetDeviceListerImpl(
21       ServiceDiscoveryClient* service_discovery_client,
22       PrivetDeviceLister::Delegate* delegate,
23       const std::string& subtype);
24
25   PrivetDeviceListerImpl(
26       ServiceDiscoveryClient* service_discovery_client,
27       PrivetDeviceLister::Delegate* delegate);
28
29   ~PrivetDeviceListerImpl() override;
30
31   void Start() override;
32   void DiscoverNewDevices(bool force_update) override;
33
34  protected:
35   void OnDeviceChanged(bool added,
36                        const ServiceDescription& service_description) override;
37   void OnDeviceRemoved(const std::string& service_name) override;
38   void OnDeviceCacheFlushed() override;
39
40  private:
41   PrivetDeviceLister::Delegate* delegate_;
42   ServiceDiscoveryDeviceLister device_lister_;
43 };
44
45 }  // namespace local_discovery
46
47 #endif  // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_IMPL_H_