summaryrefslogtreecommitdiffstats
path: root/content/public/browser/devtools_target.h
blob: 3fcac0572f3299c11ba5aa2d9d8e100f8ffc2726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_H_
#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_H_

#include <string>

#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "url/gurl.h"

namespace content {

class DevToolsAgentHost;

// DevToolsTarget represents an inspectable target and can be used to
// manipulate the target and query its details.
// Instantiation and discovery of DevToolsTarget instances is the responsibility
// of DevToolsHttpHandlerDelegate.
class DevToolsTarget {
 public:
  virtual ~DevToolsTarget() {}

  // Returns the unique target id.
  virtual std::string GetId() const = 0;

  // Returns the target type.
  virtual std::string GetType() const = 0;

  // Returns the target title.
  virtual std::string GetTitle() const = 0;

  // Returns the target description.
  virtual std::string GetDescription() const = 0;

  // Returns the url associated with this target.
  virtual GURL GetUrl() const = 0;

  // Returns the favicon url for this target.
  virtual GURL GetFaviconUrl() const = 0;

  // Returns the time when the target was last active.
  virtual base::TimeTicks GetLastActivityTime() const = 0;

  // Returns true if the debugger is attached to the target.
  virtual bool IsAttached() const = 0;

  // Returns the agent host for this target.
  virtual scoped_refptr<DevToolsAgentHost> GetAgentHost() const = 0;

  // Activates the target. Returns false if the operation failed.
  virtual bool Activate() const = 0;

  // Closes the target. Returns false if the operation failed.
  virtual bool Close() const = 0;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_DEVTOOLS_TARGET_H_