Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / devtools / device / tcp_device_provider.h
blobfe8c8cc3983d8f017d4a453702979788faa57379
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 CHROME_BROWSER_DEVTOOLS_DEVICE_TCP_DEVICE_PROVIDER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_TCP_DEVICE_PROVIDER_H_
8 #include <set>
10 #include "chrome/browser/devtools/device/android_device_manager.h"
11 #include "net/base/host_port_pair.h"
13 // Instantiate this class only in a test and/or when DEBUG_DEVTOOLS is defined.
14 class TCPDeviceProvider : public AndroidDeviceManager::DeviceProvider {
15 public:
16 static scoped_refptr<TCPDeviceProvider> CreateForLocalhost(uint16_t port);
18 using HostPortSet = std::set<net::HostPortPair>;
19 explicit TCPDeviceProvider(const HostPortSet& targets);
21 void QueryDevices(const SerialsCallback& callback) override;
23 void QueryDeviceInfo(const std::string& serial,
24 const DeviceInfoCallback& callback) override;
26 void OpenSocket(const std::string& serial,
27 const std::string& socket_name,
28 const SocketCallback& callback) override;
30 void ReleaseDevice(const std::string& serial) override;
32 void set_release_callback_for_test(const base::Closure& callback);
34 private:
35 ~TCPDeviceProvider() override;
37 HostPortSet targets_;
38 base::Closure release_callback_;
41 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_TCP_DEVICE_PROVIDER_H_