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

Unified Diff: device/hid/hid_service.h

Issue 419713002: Support permission_broker for chrome.hid devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix hid in app_shell after its move to //extensions Created 6 years, 5 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 | « device/hid/hid_connection_unittest.cc ('k') | device/hid/hid_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service.h
diff --git a/device/hid/hid_service.h b/device/hid/hid_service.h
index ebde59a564ef4ec6786a5fa92b6073aa9bf0bf06..c8e4e412ace568de6b05160b0cad564108bd0939 100644
--- a/device/hid/hid_service.h
+++ b/device/hid/hid_service.h
@@ -10,8 +10,7 @@
#include <vector>
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
#include "base/threading/thread_checker.h"
#include "device/hid/hid_device_info.h"
@@ -19,10 +18,12 @@ namespace device {
class HidConnection;
-class HidService : public base::MessageLoop::DestructionObserver {
+class HidService {
public:
- // Must be called on FILE thread.
- static HidService* GetInstance();
+ static HidService* Create(
+ scoped_refptr<base::MessageLoopProxy> ui_message_loop);
+
+ virtual ~HidService();
// Enumerates and returns a list of device identifiers.
virtual void GetDevices(std::vector<HidDeviceInfo>* devices);
@@ -34,19 +35,12 @@ class HidService : public base::MessageLoop::DestructionObserver {
virtual scoped_refptr<HidConnection> Connect(
const HidDeviceId& device_id) = 0;
- // Implements base::MessageLoop::DestructionObserver
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
-
protected:
- friend struct base::DefaultDeleter<HidService>;
friend class HidConnectionTest;
typedef std::map<HidDeviceId, HidDeviceInfo> DeviceMap;
HidService();
- virtual ~HidService();
-
- static HidService* CreateInstance();
void AddDevice(const HidDeviceInfo& info);
void RemoveDevice(const HidDeviceId& device_id);
« no previous file with comments | « device/hid/hid_connection_unittest.cc ('k') | device/hid/hid_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698