Home | History | Annotate | Download | only in core
      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 DEVICE_CORE_DEVICE_CLIENT_H_
      6 #define DEVICE_CORE_DEVICE_CLIENT_H_
      7 
      8 #include "base/macros.h"
      9 
     10 namespace device {
     11 
     12 class HidService;
     13 class UsbService;
     14 
     15 // Interface used by consumers of //device APIs to get pointers to the service
     16 // singletons appropriate for a given embedding application. For an example see
     17 // //chrome/browser/chrome_device_client.h.
     18 class DeviceClient {
     19  public:
     20   // Construction sets the single instance.
     21   DeviceClient();
     22 
     23   // Destruction clears the single instance.
     24   ~DeviceClient();
     25 
     26   // Returns the single instance of |this|.
     27   static DeviceClient* Get();
     28 
     29   // Returns the UsbService instance for this embedder.
     30   virtual UsbService* GetUsbService();
     31 
     32   // Returns the HidService instance for this embedder.
     33   virtual HidService* GetHidService();
     34 
     35  private:
     36   DISALLOW_COPY_AND_ASSIGN(DeviceClient);
     37 };
     38 
     39 }  // namespace device
     40 
     41 #endif  // DEVICE_CORE_DEVICE_CLIENT_H_
     42