OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ | 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 class DevToolsWindow | 37 class DevToolsWindow |
38 : public DevToolsClientHost, | 38 : public DevToolsClientHost, |
39 private content::NotificationObserver, | 39 private content::NotificationObserver, |
40 private TabContentsDelegate, | 40 private TabContentsDelegate, |
41 private RenderViewHostObserver { | 41 private RenderViewHostObserver { |
42 public: | 42 public: |
43 static const char kDevToolsApp[]; | 43 static const char kDevToolsApp[]; |
44 static void RegisterUserPrefs(PrefService* prefs); | 44 static void RegisterUserPrefs(PrefService* prefs); |
45 static TabContentsWrapper* GetDevToolsContents(TabContents* inspected_tab); | 45 static TabContentsWrapper* GetDevToolsContents(TabContents* inspected_tab); |
| 46 static DevToolsWindow* FindDevToolsWindow(RenderViewHost* window_rvh); |
46 | 47 |
47 static DevToolsWindow* OpenDevToolsWindowForWorker( | 48 static DevToolsWindow* OpenDevToolsWindowForWorker( |
48 Profile* profile, | 49 Profile* profile, |
49 DevToolsAgentHost* worker_agent); | 50 DevToolsAgentHost* worker_agent); |
50 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); | 51 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); |
51 static DevToolsWindow* OpenDevToolsWindow(RenderViewHost* inspected_rvh); | 52 static DevToolsWindow* OpenDevToolsWindow(RenderViewHost* inspected_rvh); |
52 static DevToolsWindow* ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | 53 static DevToolsWindow* ToggleDevToolsWindow(RenderViewHost* inspected_rvh, |
53 DevToolsToggleAction action); | 54 DevToolsToggleAction action); |
54 static void InspectElement(RenderViewHost* inspected_rvh, int x, int y); | 55 static void InspectElement(RenderViewHost* inspected_rvh, int x, int y); |
55 | 56 |
56 virtual ~DevToolsWindow(); | 57 virtual ~DevToolsWindow(); |
57 | 58 |
58 // Overridden from DevToolsClientHost. | 59 // Overridden from DevToolsClientHost. |
59 virtual void SendMessageToClient(const IPC::Message& message) OVERRIDE; | 60 virtual void SendMessageToClient(const IPC::Message& message) OVERRIDE; |
60 virtual void InspectedTabClosing() OVERRIDE; | 61 virtual void InspectedTabClosing() OVERRIDE; |
61 virtual void TabReplaced(TabContents* new_tab) OVERRIDE; | 62 virtual void TabReplaced(TabContents* new_tab) OVERRIDE; |
| 63 virtual RenderViewHost* GetClientRenderViewHost() OVERRIDE; |
62 RenderViewHost* GetRenderViewHost(); | 64 RenderViewHost* GetRenderViewHost(); |
63 | 65 |
64 void Show(DevToolsToggleAction action); | 66 void Show(DevToolsToggleAction action); |
65 | 67 |
66 TabContentsWrapper* tab_contents() { return tab_contents_; } | 68 TabContentsWrapper* tab_contents() { return tab_contents_; } |
67 Browser* browser() { return browser_; } // For tests. | 69 Browser* browser() { return browser_; } // For tests. |
68 bool is_docked() { return docked_; } | 70 bool is_docked() { return docked_; } |
69 | 71 |
70 private: | 72 private: |
71 static DevToolsWindow* Create(Profile* profile, | 73 static DevToolsWindow* Create(Profile* profile, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 TabContentsWrapper* tab_contents_; | 144 TabContentsWrapper* tab_contents_; |
143 Browser* browser_; | 145 Browser* browser_; |
144 bool docked_; | 146 bool docked_; |
145 bool is_loaded_; | 147 bool is_loaded_; |
146 DevToolsToggleAction action_on_load_; | 148 DevToolsToggleAction action_on_load_; |
147 content::NotificationRegistrar registrar_; | 149 content::NotificationRegistrar registrar_; |
148 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 150 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
149 }; | 151 }; |
150 | 152 |
151 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ | 153 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
OLD | NEW |