OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/public/browser/devtools_agent_host.h" | 12 #include "content/public/browser/devtools_agent_host.h" |
13 #include "content/public/browser/devtools_client_host.h" | 13 #include "content/public/browser/devtools_client_host.h" |
14 #include "content/public/browser/devtools_frontend_host_delegate.h" | 14 #include "content/public/browser/devtools_frontend_host_delegate.h" |
15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class RenderViewHost; | 19 class RenderViewHost; |
20 class Shell; | 20 class Shell; |
21 class WebContents; | 21 class WebContents; |
22 | 22 |
23 class ShellDevToolsFrontend : public WebContentsObserver, | 23 class ShellDevToolsFrontend : public WebContentsObserver, |
24 public DevToolsFrontendHostDelegate { | 24 public DevToolsFrontendHostDelegate { |
25 public: | 25 public: |
26 static ShellDevToolsFrontend* Show(WebContents* inspected_contents); | 26 static ShellDevToolsFrontend* Show(WebContents* inspected_contents); |
| 27 void Activate(); |
27 void Focus(); | 28 void Focus(); |
28 void Close(); | 29 void Close(); |
29 | 30 |
30 Shell* frontend_shell() const { return frontend_shell_; } | 31 Shell* frontend_shell() const { return frontend_shell_; } |
31 | 32 |
32 private: | 33 private: |
33 ShellDevToolsFrontend(Shell* frontend_shell, DevToolsAgentHost* agent_host); | 34 ShellDevToolsFrontend(Shell* frontend_shell, DevToolsAgentHost* agent_host); |
34 virtual ~ShellDevToolsFrontend(); | 35 virtual ~ShellDevToolsFrontend(); |
35 | 36 |
36 // WebContentsObserver overrides | 37 // WebContentsObserver overrides |
37 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 38 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
38 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; | 39 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE; |
39 | 40 |
40 // DevToolsFrontendHostDelegate implementation | 41 // DevToolsFrontendHostDelegate implementation |
41 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE {} | 42 virtual void DispatchOnEmbedder(const std::string& message) OVERRIDE {} |
42 | 43 |
43 virtual void InspectedContentsClosing() OVERRIDE; | 44 virtual void InspectedContentsClosing() OVERRIDE; |
44 | 45 |
45 Shell* frontend_shell_; | 46 Shell* frontend_shell_; |
46 scoped_refptr<DevToolsAgentHost> agent_host_; | 47 scoped_refptr<DevToolsAgentHost> agent_host_; |
47 scoped_ptr<DevToolsClientHost> frontend_host_; | 48 scoped_ptr<DevToolsClientHost> frontend_host_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend); | 50 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace content | 53 } // namespace content |
53 | 54 |
54 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 55 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
OLD | NEW |