Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / devtools / devtools_target_impl.h
blobb17f3006c6931d75b89b401b75c30349b09a1bb7
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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGET_IMPL_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGET_IMPL_H_
8 #include <vector>
10 #include "base/callback.h"
11 #include "content/public/browser/devtools_target.h"
12 #include "content/public/browser/worker_service.h"
14 class Profile;
16 namespace content {
17 class DevToolsAgentHost;
18 class RenderViewHost;
21 class DevToolsTargetImpl : public content::DevToolsTarget {
22 public:
24 DevToolsTargetImpl();
25 virtual ~DevToolsTargetImpl();
27 // content::DevToolsTarget overrides:
28 virtual std::string GetId() const OVERRIDE;
29 virtual std::string GetType() const OVERRIDE;
30 virtual std::string GetTitle() const OVERRIDE;
31 virtual std::string GetDescription() const OVERRIDE;
32 virtual GURL GetUrl() const OVERRIDE;
33 virtual GURL GetFaviconUrl() const OVERRIDE;
34 virtual base::TimeTicks GetLastActivityTime() const OVERRIDE;
35 virtual bool IsAttached() const OVERRIDE;
36 virtual scoped_refptr<content::DevToolsAgentHost> GetAgentHost() const
37 OVERRIDE;
38 virtual bool Activate() const OVERRIDE;
39 virtual bool Close() const OVERRIDE;
41 // Returns the RenderViewHost associated with the target on NULL if there is
42 // not any.
43 virtual content::RenderViewHost* GetRenderViewHost() const;
45 // Returns the tab id if the target is associated with a tab, -1 otherwise.
46 virtual int GetTabId() const;
48 // Returns the extension id if the target is associated with an extension
49 // background page.
50 virtual std::string GetExtensionId() const;
52 // Open a new DevTools window or activate the existing one.
53 virtual void Inspect(Profile* profile) const;
55 // Reload the target page.
56 virtual void Reload() const;
58 // Creates a new target associated with RenderViewHost.
59 static scoped_ptr<DevToolsTargetImpl> CreateForRenderViewHost(
60 content::RenderViewHost*, bool is_tab);
62 typedef std::vector<DevToolsTargetImpl*> List;
63 typedef base::Callback<void(const List&)> Callback;
65 static List EnumerateRenderViewHostTargets();
66 static void EnumerateWorkerTargets(Callback callback);
67 static void EnumerateAllTargets(Callback callback);
69 protected:
70 scoped_refptr<content::DevToolsAgentHost> agent_host_;
71 std::string id_;
72 std::string type_;
73 std::string title_;
74 std::string description_;
75 GURL url_;
76 GURL favicon_url_;
77 base::TimeTicks last_activity_time_;
80 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_TARGET_IMPL_H_