Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / browser / api / hid / hid_connection_resource.h
blob4d884e5f41843d44b963291ad1277d9b7ada086b
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"
15 namespace device {
16 class HidConnection;
19 namespace extensions {
21 class HidConnectionResource : public ApiResource {
22 public:
23 static const content::BrowserThread::ID kThreadId =
24 content::BrowserThread::UI;
26 HidConnectionResource(const std::string& owner_extension_id,
27 scoped_refptr<device::HidConnection> connection);
28 ~HidConnectionResource() override;
30 scoped_refptr<device::HidConnection> connection() const {
31 return connection_;
34 bool IsPersistent() const override;
36 static const char* service_name() { return "HidConnectionResourceManager"; }
38 private:
39 scoped_refptr<device::HidConnection> connection_;
41 DISALLOW_COPY_AND_ASSIGN(HidConnectionResource);
44 } // namespace extensions
46 #endif // EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_