Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2749)

Unified Diff: device/usb/usb_device.h

Issue 809743006: Add an Observer interface to UsbService for device add/remove. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify comment. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/device_permissions_manager_unittest.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device.h
diff --git a/device/usb/usb_device.h b/device/usb/usb_device.h
index 8b8ec6232134ba9f3b184c42214197222ebea142..5201ed7c7d4c0c4858671bcc5259c681a7a4b020 100644
--- a/device/usb/usb_device.h
+++ b/device/usb/usb_device.h
@@ -8,7 +8,6 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"
-#include "base/observer_list.h"
#include "base/strings/string16.h"
namespace device {
@@ -21,11 +20,6 @@ struct UsbConfigDescriptor;
// UsbDeviceHandle must be created from Open() method.
class UsbDevice : public base::RefCountedThreadSafe<UsbDevice> {
public:
- class Observer {
- public:
- virtual void OnDisconnect(scoped_refptr<UsbDevice> device) = 0;
- };
-
// Accessors to basic information.
uint16 vendor_id() const { return vendor_id_; }
uint16 product_id() const { return product_id_; }
@@ -70,14 +64,10 @@ class UsbDevice : public base::RefCountedThreadSafe<UsbDevice> {
// TODO(reillyg): Make this available from the UI thread. crbug.com/427985
virtual bool GetSerialNumber(base::string16* serial) = 0;
- void AddObserver(Observer* obs) { observer_list_.AddObserver(obs); }
- void RemoveObserver(Observer* obs) { observer_list_.RemoveObserver(obs); }
-
protected:
- UsbDevice(uint16 vendor_id, uint16 product_id, uint32 unique_id);
- virtual ~UsbDevice();
-
- void NotifyDisconnect();
+ UsbDevice(uint16 vendor_id, uint16 product_id, uint32 unique_id)
+ : vendor_id_(vendor_id), product_id_(product_id), unique_id_(unique_id) {}
+ virtual ~UsbDevice() {}
private:
friend class base::RefCountedThreadSafe<UsbDevice>;
@@ -86,8 +76,6 @@ class UsbDevice : public base::RefCountedThreadSafe<UsbDevice> {
const uint16 product_id_;
const uint32 unique_id_;
- ObserverList<Observer> observer_list_;
-
DISALLOW_COPY_AND_ASSIGN(UsbDevice);
};
« no previous file with comments | « chrome/browser/extensions/api/device_permissions_manager_unittest.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698