OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
13 #include "chrome/browser/debugger/devtools_client_host.h" | 13 #include "chrome/browser/debugger/devtools_client_host.h" |
| 14 #include "chrome/browser/debugger/devtools_toggle_action.h" |
14 | 15 |
15 namespace IPC { | 16 namespace IPC { |
16 class Message; | 17 class Message; |
17 } | 18 } |
18 | 19 |
19 class GURL; | 20 class GURL; |
20 class PrefService; | 21 class PrefService; |
21 class RenderViewHost; | 22 class RenderViewHost; |
22 | 23 |
23 // This class is a singleton that manages DevToolsClientHost instances and | 24 // This class is a singleton that manages DevToolsClientHost instances and |
(...skipping 23 matching lines...) Expand all Loading... |
47 const IPC::Message& message); | 48 const IPC::Message& message); |
48 void ForwardToDevToolsClient(RenderViewHost* inspected_rvh, | 49 void ForwardToDevToolsClient(RenderViewHost* inspected_rvh, |
49 const IPC::Message& message); | 50 const IPC::Message& message); |
50 | 51 |
51 void ActivateWindow(RenderViewHost* client_rvn); | 52 void ActivateWindow(RenderViewHost* client_rvn); |
52 void CloseWindow(RenderViewHost* client_rvn); | 53 void CloseWindow(RenderViewHost* client_rvn); |
53 void RequestDockWindow(RenderViewHost* client_rvn); | 54 void RequestDockWindow(RenderViewHost* client_rvn); |
54 void RequestUndockWindow(RenderViewHost* client_rvn); | 55 void RequestUndockWindow(RenderViewHost* client_rvn); |
55 | 56 |
56 void OpenDevToolsWindow(RenderViewHost* inspected_rvh); | 57 void OpenDevToolsWindow(RenderViewHost* inspected_rvh); |
57 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, bool open_console); | 58 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, |
| 59 DevToolsToggleAction action); |
58 void RuntimeFeatureStateChanged(RenderViewHost* inspected_rvh, | 60 void RuntimeFeatureStateChanged(RenderViewHost* inspected_rvh, |
59 const std::string& feature, | 61 const std::string& feature, |
60 bool enabled); | 62 bool enabled); |
61 | 63 |
62 // Starts element inspection in the devtools client. | 64 // Starts element inspection in the devtools client. |
63 // Creates one by means of OpenDevToolsWindow if no client | 65 // Creates one by means of OpenDevToolsWindow if no client |
64 // exists. | 66 // exists. |
65 void InspectElement(RenderViewHost* inspected_rvh, int x, int y); | 67 void InspectElement(RenderViewHost* inspected_rvh, int x, int y); |
66 | 68 |
67 // Sends 'Attach' message to the agent using |dest_rvh| in case | 69 // Sends 'Attach' message to the agent using |dest_rvh| in case |
(...skipping 28 matching lines...) Expand all Loading... |
96 | 98 |
97 void SendAttachToAgent(RenderViewHost* inspected_rvh); | 99 void SendAttachToAgent(RenderViewHost* inspected_rvh); |
98 void SendDetachToAgent(RenderViewHost* inspected_rvh); | 100 void SendDetachToAgent(RenderViewHost* inspected_rvh); |
99 | 101 |
100 void ForceReopenWindow(); | 102 void ForceReopenWindow(); |
101 | 103 |
102 DevToolsClientHost* FindOnwerDevToolsClientHost(RenderViewHost* client_rvh); | 104 DevToolsClientHost* FindOnwerDevToolsClientHost(RenderViewHost* client_rvh); |
103 | 105 |
104 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | 106 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, |
105 bool force_open, | 107 bool force_open, |
106 bool open_console); | 108 DevToolsToggleAction action); |
107 | 109 |
108 void ReopenWindow(RenderViewHost* client_rvh, bool docked); | 110 void ReopenWindow(RenderViewHost* client_rvh, bool docked); |
109 | 111 |
110 void BindClientHost(RenderViewHost* inspected_rvh, | 112 void BindClientHost(RenderViewHost* inspected_rvh, |
111 DevToolsClientHost* client_host, | 113 DevToolsClientHost* client_host, |
112 const RuntimeFeatures& runtime_features); | 114 const RuntimeFeatures& runtime_features); |
113 | 115 |
114 void UnbindClientHost(RenderViewHost* inspected_rvh, | 116 void UnbindClientHost(RenderViewHost* inspected_rvh, |
115 DevToolsClientHost* client_host); | 117 DevToolsClientHost* client_host); |
116 | 118 |
(...skipping 22 matching lines...) Expand all Loading... |
139 | 141 |
140 typedef std::map<int, std::pair<DevToolsClientHost*, RuntimeFeatures> > | 142 typedef std::map<int, std::pair<DevToolsClientHost*, RuntimeFeatures> > |
141 OrphanClientHosts; | 143 OrphanClientHosts; |
142 OrphanClientHosts orphan_client_hosts_; | 144 OrphanClientHosts orphan_client_hosts_; |
143 int last_orphan_cookie_; | 145 int last_orphan_cookie_; |
144 | 146 |
145 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); | 147 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
146 }; | 148 }; |
147 | 149 |
148 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 150 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
OLD | NEW |