| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/debugger/devtools_toggle_action.h" | 14 #include "chrome/browser/debugger/devtools_toggle_action.h" |
| 15 #include "content/browser/debugger/devtools_client_host.h" | |
| 16 #include "content/browser/renderer_host/render_view_host_observer.h" | 15 #include "content/browser/renderer_host/render_view_host_observer.h" |
| 17 #include "content/browser/tab_contents/tab_contents_delegate.h" | 16 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 17 #include "content/public/browser/devtools/devtools_client_host.h" |
| 18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 | 20 |
| 21 namespace IPC { | 21 namespace IPC { |
| 22 class Message; | 22 class Message; |
| 23 } | 23 } |
| 24 | 24 |
| 25 class Browser; | 25 class Browser; |
| 26 class BrowserWindow; | 26 class BrowserWindow; |
| 27 class DevToolsAgentHost; | |
| 28 class PrefService; | 27 class PrefService; |
| 29 class Profile; | 28 class Profile; |
| 30 class RenderViewHost; | 29 class RenderViewHost; |
| 31 class TabContentsWrapper; | 30 class TabContentsWrapper; |
| 32 | 31 |
| 33 namespace base { | 32 namespace base { |
| 34 class Value; | 33 class Value; |
| 35 } | 34 } |
| 36 | 35 |
| 36 namespace content { |
| 37 class DevToolsAgentHost; |
| 38 } |
| 39 |
| 37 class DevToolsWindow | 40 class DevToolsWindow |
| 38 : public DevToolsClientHost, | 41 : public content::DevToolsClientHost, |
| 39 private content::NotificationObserver, | 42 private content::NotificationObserver, |
| 40 private TabContentsDelegate, | 43 private TabContentsDelegate, |
| 41 private RenderViewHostObserver { | 44 private RenderViewHostObserver { |
| 42 public: | 45 public: |
| 43 static const char kDevToolsApp[]; | 46 static const char kDevToolsApp[]; |
| 44 static void RegisterUserPrefs(PrefService* prefs); | 47 static void RegisterUserPrefs(PrefService* prefs); |
| 45 static TabContentsWrapper* GetDevToolsContents(TabContents* inspected_tab); | 48 static TabContentsWrapper* GetDevToolsContents(TabContents* inspected_tab); |
| 46 static DevToolsWindow* FindDevToolsWindow(RenderViewHost* window_rvh); | 49 static DevToolsWindow* FindDevToolsWindow(RenderViewHost* window_rvh); |
| 47 | 50 |
| 48 static DevToolsWindow* OpenDevToolsWindowForWorker( | 51 static DevToolsWindow* OpenDevToolsWindowForWorker( |
| 49 Profile* profile, | 52 Profile* profile, |
| 50 DevToolsAgentHost* worker_agent); | 53 content::DevToolsAgentHost* worker_agent); |
| 51 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); | 54 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); |
| 52 static DevToolsWindow* OpenDevToolsWindow(RenderViewHost* inspected_rvh); | 55 static DevToolsWindow* OpenDevToolsWindow(RenderViewHost* inspected_rvh); |
| 53 static DevToolsWindow* ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | 56 static DevToolsWindow* ToggleDevToolsWindow(RenderViewHost* inspected_rvh, |
| 54 DevToolsToggleAction action); | 57 DevToolsToggleAction action); |
| 55 static void InspectElement(RenderViewHost* inspected_rvh, int x, int y); | 58 static void InspectElement(RenderViewHost* inspected_rvh, int x, int y); |
| 56 | 59 |
| 57 virtual ~DevToolsWindow(); | 60 virtual ~DevToolsWindow(); |
| 58 | 61 |
| 59 // Overridden from DevToolsClientHost. | 62 // Overridden from DevToolsClientHost. |
| 60 virtual void SendMessageToClient(const IPC::Message& message); | 63 virtual void SendMessageToClient(const IPC::Message& message); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 118 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 116 bool* is_keyboard_shortcut); | 119 bool* is_keyboard_shortcut); |
| 117 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 120 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 118 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator(); | 121 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator(); |
| 119 | 122 |
| 120 virtual void FrameNavigating(const std::string& url) {} | 123 virtual void FrameNavigating(const std::string& url) {} |
| 121 | 124 |
| 122 static DevToolsWindow* ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | 125 static DevToolsWindow* ToggleDevToolsWindow(RenderViewHost* inspected_rvh, |
| 123 bool force_open, | 126 bool force_open, |
| 124 DevToolsToggleAction action); | 127 DevToolsToggleAction action); |
| 125 static DevToolsWindow* AsDevToolsWindow(DevToolsClientHost*); | 128 static DevToolsWindow* AsDevToolsWindow(content::DevToolsClientHost*); |
| 126 | 129 |
| 127 // RenderViewHostObserver overrides. | 130 // RenderViewHostObserver overrides. |
| 128 virtual void RenderViewHostDestroyed(RenderViewHost* rvh) OVERRIDE; | 131 virtual void RenderViewHostDestroyed(RenderViewHost* rvh) OVERRIDE; |
| 129 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 132 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 130 | 133 |
| 131 void OnActivateWindow(); | 134 void OnActivateWindow(); |
| 132 void OnCloseWindow(); | 135 void OnCloseWindow(); |
| 133 void OnMoveWindow(int x, int y); | 136 void OnMoveWindow(int x, int y); |
| 134 void OnRequestDockWindow(); | 137 void OnRequestDockWindow(); |
| 135 void OnRequestUndockWindow(); | 138 void OnRequestUndockWindow(); |
| 136 void OnSaveAs(const std::string& file_name, | 139 void OnSaveAs(const std::string& file_name, |
| 137 const std::string& content); | 140 const std::string& content); |
| 138 void RequestSetDocked(bool docked); | 141 void RequestSetDocked(bool docked); |
| 139 | 142 |
| 140 Profile* profile_; | 143 Profile* profile_; |
| 141 TabContentsWrapper* inspected_tab_; | 144 TabContentsWrapper* inspected_tab_; |
| 142 TabContentsWrapper* tab_contents_; | 145 TabContentsWrapper* tab_contents_; |
| 143 Browser* browser_; | 146 Browser* browser_; |
| 144 bool docked_; | 147 bool docked_; |
| 145 bool is_loaded_; | 148 bool is_loaded_; |
| 146 DevToolsToggleAction action_on_load_; | 149 DevToolsToggleAction action_on_load_; |
| 147 content::NotificationRegistrar registrar_; | 150 content::NotificationRegistrar registrar_; |
| 148 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 151 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ | 154 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_WINDOW_H_ |
| OLD | NEW |