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

Side by Side Diff: chrome/browser/extensions/api/hid/hid_connection_resource.h

Issue 161823002: Clean up HID backend and API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_HID_HID_DEVICE_RESOURCE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_HID_HID_CONNECTION_RESOURCE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_HID_HID_DEVICE_RESOURCE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_HID_HID_CONNECTION_RESOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h"
11 #include "base/lazy_instance.h"
12 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
13 #include "chrome/browser/extensions/api/api_resource.h" 11 #include "chrome/browser/extensions/api/api_resource.h"
14 #include "chrome/browser/extensions/api/api_resource_manager.h" 12 #include "chrome/browser/extensions/api/api_resource_manager.h"
15 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
16 #include "device/hid/hid_connection.h" 14 #include "device/hid/hid_connection.h"
17 #include "device/hid/hid_device_info.h"
18
19 namespace net {
20 class IOBuffer;
21 } // namespace net
22 15
23 namespace extensions { 16 namespace extensions {
24 17
25 class HidConnectionResource : public ApiResource { 18 class HidConnectionResource : public ApiResource {
26 public: 19 public:
27 HidConnectionResource(const std::string& owner_extension_id, 20 HidConnectionResource(const std::string& owner_extension_id,
28 scoped_refptr<device::HidConnection> connection); 21 scoped_refptr<device::HidConnection> connection);
29
30 virtual ~HidConnectionResource(); 22 virtual ~HidConnectionResource();
31 23
32 scoped_refptr<device::HidConnection> connection() { 24 scoped_refptr<device::HidConnection> connection() const {
33 return connection_; 25 return connection_;
34 } 26 }
35 27
36 private: 28 private:
37 friend class ApiResourceManager<HidConnectionResource>; 29 friend class ApiResourceManager<HidConnectionResource>;
38 static const char* service_name() {
39 return "HidDeviceResourceManager";
40 }
41 30
31 static const char* service_name() { return "HidConnectionResourceManager"; }
42 32
43 static const content::BrowserThread::ID kThreadId = 33 static const content::BrowserThread::ID kThreadId =
44 content::BrowserThread::FILE; 34 content::BrowserThread::FILE;
45 35
46 scoped_refptr<device::HidConnection> connection_; 36 scoped_refptr<device::HidConnection> connection_;
47 37
48 DISALLOW_COPY_AND_ASSIGN(HidConnectionResource); 38 DISALLOW_COPY_AND_ASSIGN(HidConnectionResource);
49 }; 39 };
50 40
51 } // namespace extensions 41 } // namespace extensions
52 42
53 #endif // CHROME_BROWSER_EXTENSIONS_API_HID_HID_DEVICE_RESOURCE_H_ 43 #endif // CHROME_BROWSER_EXTENSIONS_API_HID_HID_CONNECTION_RESOURCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/hid/hid_api.cc ('k') | chrome/browser/extensions/api/hid/hid_connection_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698