1 // Copyright 2013 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_H_
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_H_
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/time/time.h"
13 #include "content/common/content_export.h"
18 class DevToolsAgentHost
;
20 // DevToolsTarget represents an inspectable target and can be used to
21 // manipulate the target and query its details.
22 // Instantiation and discovery of DevToolsTarget instances is the responsibility
23 // of DevToolsHttpHandlerDelegate.
24 class DevToolsTarget
{
26 virtual ~DevToolsTarget() {}
28 // Returns the unique target id.
29 virtual std::string
GetId() const = 0;
31 // Returns the id of the parent target, or empty string if no parent.
32 virtual std::string
GetParentId() const = 0;
34 // Returns the target type.
35 virtual std::string
GetType() const = 0;
37 // Returns the target title.
38 virtual std::string
GetTitle() const = 0;
40 // Returns the target description.
41 virtual std::string
GetDescription() const = 0;
43 // Returns the url associated with this target.
44 virtual GURL
GetURL() const = 0;
46 // Returns the favicon url for this target.
47 virtual GURL
GetFaviconURL() const = 0;
49 // Returns the time when the target was last active.
50 virtual base::TimeTicks
GetLastActivityTime() const = 0;
52 // Returns true if the debugger is attached to the target.
53 virtual bool IsAttached() const = 0;
55 // Returns the agent host for this target.
56 virtual scoped_refptr
<DevToolsAgentHost
> GetAgentHost() const = 0;
58 // Activates the target. Returns false if the operation failed.
59 virtual bool Activate() const = 0;
61 // Closes the target. Returns false if the operation failed.
62 virtual bool Close() const = 0;
65 } // namespace content
67 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_H_