Don't preload rarely seen large images
[chromium-blink-merge.git] / components / devtools_discovery / devtools_target_descriptor.h
blob9b3200dd65a53d14adaaea508cb744946b2d1697
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_
6 #define COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/time/time.h"
14 #include "url/gurl.h"
16 namespace content {
17 class DevToolsAgentHost;
20 namespace devtools_discovery {
22 // DevToolsTargetDescriptor provides information about devtools target
23 // and can be used to manipulate the target and query its details.
24 // Instantiation and discovery of DevToolsTargetDescriptor instances
25 // is the responsibility of DevToolsDiscoveryManager.
26 class DevToolsTargetDescriptor {
27 public:
28 using List = std::vector<DevToolsTargetDescriptor*>;
29 virtual ~DevToolsTargetDescriptor() {}
31 // Returns the unique target id.
32 virtual std::string GetId() const = 0;
34 // Returns the id of the parent target, or empty string if no parent.
35 virtual std::string GetParentId() const = 0;
37 // Returns the target type.
38 virtual std::string GetType() const = 0;
40 // Returns the target title.
41 virtual std::string GetTitle() const = 0;
43 // Returns the target description.
44 virtual std::string GetDescription() const = 0;
46 // Returns the url associated with this target.
47 virtual GURL GetURL() const = 0;
49 // Returns the favicon url for this target.
50 virtual GURL GetFaviconURL() const = 0;
52 // Returns the time when the target was last active.
53 virtual base::TimeTicks GetLastActivityTime() const = 0;
55 // Returns true if the debugger is attached to the target.
56 virtual bool IsAttached() const = 0;
58 // Returns the agent host for this target.
59 virtual scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const = 0;
61 // Activates the target. Returns false if the operation failed.
62 virtual bool Activate() const = 0;
64 // Closes the target. Returns false if the operation failed.
65 virtual bool Close() const = 0;
68 } // namespace devtools_discovery
70 #endif // COMPONENTS_DEVTOOLS_DISCOVERY_DEVTOOLS_TARGET_DESCRIPTOR_H_