Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / devtools / device / webrtc / devtools_bridge_instances_request.h
blobad8bb7bb84a3435dd3a01eaa106aa2d488cab18a
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_WEBRTC_DEVTOOLS_BRIDGE_INSTANCES_REQUEST_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_DEVTOOLS_BRIDGE_INSTANCES_REQUEST_H_
8 #include "chrome/browser/devtools/device/android_device_manager.h"
9 #include "chrome/browser/local_discovery/gcd_api_flow.h"
11 class DevToolsBridgeInstancesRequest
12 : public local_discovery::GCDApiFlowRequest {
13 public:
14 struct Instance {
15 std::string id;
16 std::string display_name;
18 ~Instance();
21 using InstanceList = std::vector<Instance>;
23 class Delegate {
24 public:
25 virtual void OnDevToolsBridgeInstancesRequestSucceeded(
26 const InstanceList& result) = 0;
27 virtual void OnDevToolsBridgeInstancesRequestFailed() = 0;
29 protected:
30 ~Delegate() {}
33 explicit DevToolsBridgeInstancesRequest(Delegate* delegate);
34 ~DevToolsBridgeInstancesRequest() override;
36 // Implementation of GCDApiFlowRequest.
37 void OnGCDAPIFlowError(local_discovery::GCDApiFlow::Status status) override;
38 void OnGCDAPIFlowComplete(const base::DictionaryValue& value) override;
39 GURL GetURL() override;
41 private:
42 void TryAddInstance(const base::DictionaryValue& device_value);
44 Delegate* const delegate_;
45 InstanceList result_;
47 DISALLOW_COPY_AND_ASSIGN(DevToolsBridgeInstancesRequest);
50 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_DEVTOOLS_BRIDGE_INSTANCES_REQUEST_H_