blob: 4d884e5f41843d44b963291ad1277d9b7ada086b [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_
#define EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_
#include <string>
#include "base/memory/ref_counted.h"
#include "content/public/browser/browser_thread.h"
#include "device/hid/hid_connection.h"
#include "extensions/browser/api/api_resource.h"
namespace device {
class HidConnection;
}
namespace extensions {
class HidConnectionResource : public ApiResource {
public:
static const content::BrowserThread::ID kThreadId =
content::BrowserThread::UI;
HidConnectionResource(const std::string& owner_extension_id,
scoped_refptr<device::HidConnection> connection);
~HidConnectionResource() override;
scoped_refptr<device::HidConnection> connection() const {
return connection_;
}
bool IsPersistent() const override;
static const char* service_name() { return "HidConnectionResourceManager"; }
private:
scoped_refptr<device::HidConnection> connection_;
DISALLOW_COPY_AND_ASSIGN(HidConnectionResource);
};
} // namespace extensions
#endif // EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_