Home | History | Annotate | Download | only in local_discovery
      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   virtual ~PrivetDeviceListerImpl();
     30 
     31   virtual void Start() OVERRIDE;
     32   virtual void DiscoverNewDevices(bool force_update) OVERRIDE;
     33 
     34  protected:
     35   virtual void OnDeviceChanged(
     36       bool added,
     37       const ServiceDescription& service_description) OVERRIDE;
     38   virtual void OnDeviceRemoved(const std::string& service_name) OVERRIDE;
     39   virtual void OnDeviceCacheFlushed() OVERRIDE;
     40 
     41  private:
     42   PrivetDeviceLister::Delegate* delegate_;
     43   ServiceDiscoveryDeviceLister device_lister_;
     44 };
     45 
     46 }  // namespace local_discovery
     47 
     48 #endif  // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_DEVICE_LISTER_IMPL_H_
     49