Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / extensions / browser / api / hid / hid_connection_resource.h
blob13d6a116b6beaf7e08790ea02395b902c7ac2958
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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_
6 #define EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "content/public/browser/browser_thread.h"
12 #include "device/hid/hid_connection.h"
13 #include "extensions/browser/api/api_resource.h"
14 #include "extensions/browser/api/api_resource_manager.h"
16 namespace extensions {
18 class HidConnectionResource : public ApiResource {
19 public:
20 HidConnectionResource(const std::string& owner_extension_id,
21 scoped_refptr<device::HidConnection> connection);
22 virtual ~HidConnectionResource();
24 scoped_refptr<device::HidConnection> connection() const {
25 return connection_;
28 static const char* service_name() { return "HidConnectionResourceManager"; }
30 static const content::BrowserThread::ID kThreadId =
31 content::BrowserThread::FILE;
33 private:
34 scoped_refptr<device::HidConnection> connection_;
36 DISALLOW_COPY_AND_ASSIGN(HidConnectionResource);
39 } // namespace extensions
41 #endif // EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_