Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / components / webusb / webusb_detector.h
blob2695d962f140084805cb672198e48d2cded27ab1
1 // Copyright 2015 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.
5 #ifndef COMPONENTS_WEBUSB_WEBUSB_DETECTOR_H_
6 #define COMPONENTS_WEBUSB_WEBUSB_DETECTOR_H_
8 #include "base/scoped_observer.h"
9 #include "device/usb/usb_service.h"
11 namespace device {
12 class UsbDevice;
15 namespace webusb {
17 class UsbDevice;
18 class WebUsbBrowserClient;
20 class WebUsbDetector : public device::UsbService::Observer {
21 public:
22 explicit WebUsbDetector(WebUsbBrowserClient* webusb_browser_client);
24 ~WebUsbDetector() override;
26 private:
27 // Initializes the WebUsbDetector.
28 void Initialize();
30 // UsbService::observer override:
31 void OnDeviceAdded(scoped_refptr<device::UsbDevice> device) override;
33 // UsbService::observer override:
34 void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) override;
36 WebUsbBrowserClient* webusb_browser_client_ = nullptr;
38 ScopedObserver<device::UsbService, device::UsbService::Observer> observer_;
40 DISALLOW_COPY_AND_ASSIGN(WebUsbDetector);
43 } // namespace webusb
45 #endif // COMPONENTS_WEBUSB_WEBUSB_DETECTOR_H_