summaryrefslogtreecommitdiffstats
path: root/chrome/browser/devtools/device/self_device_provider.h
blob: 4200dc3b3965f4d0047525c596af4a155f6b1b56 (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
34
35
// 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 CHROME_BROWSER_DEVTOOLS_DEVICE_SELF_DEVICE_PROVIDER_H_
#define CHROME_BROWSER_DEVTOOLS_DEVICE_SELF_DEVICE_PROVIDER_H_

#include "chrome/browser/devtools/device/android_device_manager.h"

// Instantiate this class only in a test and/or when DEBUG_DEVTOOLS is defined.
class SelfAsDeviceProvider : public AndroidDeviceManager::DeviceProvider {
 public:
  explicit SelfAsDeviceProvider(int port);

  void QueryDevices(const SerialsCallback& callback) override;

  void QueryDeviceInfo(const std::string& serial,
                       const DeviceInfoCallback& callback) override;

  void OpenSocket(const std::string& serial,
                  const std::string& socket_name,
                  const SocketCallback& callback) override;

  void ReleaseDevice(const std::string& serial) override;

  void set_release_callback_for_test(const base::Closure& callback);

 private:
  ~SelfAsDeviceProvider() override;

  int port_;
  base::Closure release_callback_;
};

#endif  // CHROME_BROWSER_DEVTOOLS_DEVICE_SELF_DEVICE_PROVIDER_H_