summaryrefslogtreecommitdiff
path: root/chromium/content/public/browser/hid_chooser.h
blob: d40cf59be7a73cefc0c313149c80cb664e8d59b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2019 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 CONTENT_PUBLIC_BROWSER_HID_CHOOSER_H_
#define CONTENT_PUBLIC_BROWSER_HID_CHOOSER_H_

#include "base/callback_forward.h"
#include "base/macros.h"
#include "content/common/content_export.h"
#include "services/device/public/mojom/hid.mojom-forward.h"

namespace content {

// Token representing an open HID device chooser prompt. Destroying this
// object should cancel the prompt.
class CONTENT_EXPORT HidChooser {
 public:
  // Callback type used to report the user action. An empty vector is passed if
  // no device was selected.
  using Callback =
      base::OnceCallback<void(std::vector<device::mojom::HidDeviceInfoPtr>)>;

  HidChooser() = default;
  virtual ~HidChooser() = default;

 private:
  DISALLOW_COPY_AND_ASSIGN(HidChooser);
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_HID_CHOOSER_H_