OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_ | 5 #ifndef COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_ |
6 #define COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_ | 6 #define COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "content/public/browser/devtools_target.h" | |
15 #include "url/gurl.h" | 14 #include "url/gurl.h" |
16 | 15 |
17 namespace content { | 16 namespace content { |
18 class DevToolsAgentHost; | 17 class DevToolsAgentHost; |
19 } | 18 } |
20 | 19 |
21 namespace devtools_discovery { | 20 namespace devtools_discovery { |
22 | 21 |
23 // DevToolsTargetDescriptor provides information about devtools target | 22 // DevToolsTargetDescriptor provides information about devtools target |
24 // and can be used to manipulate the target and query its details. | 23 // and can be used to manipulate the target and query its details. |
25 // Instantiation and discovery of DevToolsTargetDescriptor instances | 24 // Instantiation and discovery of DevToolsTargetDescriptor instances |
26 // is the responsibility of DevToolsDiscoveryManager. | 25 // is the responsibility of DevToolsDiscoveryManager. |
27 // TODO(dgozman): remove content::DevToolsTarget once every embedder migrates | 26 class DevToolsTargetDescriptor { |
28 // to this descriptor. | |
29 class DevToolsTargetDescriptor : public content::DevToolsTarget { | |
30 public: | 27 public: |
31 using List = std::vector<DevToolsTargetDescriptor*>; | 28 using List = std::vector<DevToolsTargetDescriptor*>; |
32 ~DevToolsTargetDescriptor() override {} | 29 virtual ~DevToolsTargetDescriptor() {} |
| 30 |
| 31 // Returns the unique target id. |
| 32 virtual std::string GetId() const = 0; |
| 33 |
| 34 // Returns the id of the parent target, or empty string if no parent. |
| 35 virtual std::string GetParentId() const = 0; |
| 36 |
| 37 // Returns the target type. |
| 38 virtual std::string GetType() const = 0; |
| 39 |
| 40 // Returns the target title. |
| 41 virtual std::string GetTitle() const = 0; |
| 42 |
| 43 // Returns the target description. |
| 44 virtual std::string GetDescription() const = 0; |
| 45 |
| 46 // Returns the url associated with this target. |
| 47 virtual GURL GetURL() const = 0; |
| 48 |
| 49 // Returns the favicon url for this target. |
| 50 virtual GURL GetFaviconURL() const = 0; |
| 51 |
| 52 // Returns the time when the target was last active. |
| 53 virtual base::TimeTicks GetLastActivityTime() const = 0; |
| 54 |
| 55 // Returns true if the debugger is attached to the target. |
| 56 virtual bool IsAttached() const = 0; |
| 57 |
| 58 // Returns the agent host for this target. |
| 59 virtual scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const = 0; |
| 60 |
| 61 // Activates the target. Returns false if the operation failed. |
| 62 virtual bool Activate() const = 0; |
| 63 |
| 64 // Closes the target. Returns false if the operation failed. |
| 65 virtual bool Close() const = 0; |
33 }; | 66 }; |
34 | 67 |
35 } // namespace devtools_discovery | 68 } // namespace devtools_discovery |
36 | 69 |
37 #endif // COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_ | 70 #endif // COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_ |
OLD | NEW |