OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/webusb/webusb_detector.h" | 5 #include "components/webusb/webusb_detector.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | |
8 #include "components/webusb/webusb_browser_client.h" | 7 #include "components/webusb/webusb_browser_client.h" |
9 #include "device/core/device_client.h" | 8 #include "device/core/device_client.h" |
10 #include "device/usb/usb_device.h" | 9 #include "device/usb/usb_device.h" |
11 #include "device/usb/usb_ids.h" | 10 #include "device/usb/usb_ids.h" |
12 | 11 |
13 namespace webusb { | 12 namespace webusb { |
14 | 13 |
15 WebUsbDetector::WebUsbDetector(WebUsbBrowserClient* webusb_browser_client) | 14 WebUsbDetector::WebUsbDetector(WebUsbBrowserClient* webusb_browser_client) |
16 : webusb_browser_client_(webusb_browser_client), observer_(this) { | 15 : webusb_browser_client_(webusb_browser_client), observer_(this) { |
17 Initialize(); | 16 Initialize(); |
(...skipping 30 matching lines...) Expand all Loading... |
48 webusb_browser_client_->OnDeviceAdded(product_name, landing_page, | 47 webusb_browser_client_->OnDeviceAdded(product_name, landing_page, |
49 notification_id); | 48 notification_id); |
50 } | 49 } |
51 | 50 |
52 void WebUsbDetector::OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) { | 51 void WebUsbDetector::OnDeviceRemoved(scoped_refptr<device::UsbDevice> device) { |
53 std::string notification_id = device->guid(); | 52 std::string notification_id = device->guid(); |
54 webusb_browser_client_->OnDeviceRemoved(notification_id); | 53 webusb_browser_client_->OnDeviceRemoved(notification_id); |
55 } | 54 } |
56 | 55 |
57 } // namespace webusb | 56 } // namespace webusb |
OLD | NEW |