| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" | 9 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" |
| 10 #include "chrome/browser/devtools/devtools_toggle_action.h" | 10 #include "chrome/browser/devtools/devtools_toggle_action.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // scoped_refptr<content::DevToolsAgentHost> agent( | 91 // scoped_refptr<content::DevToolsAgentHost> agent( |
| 92 // content::DevToolsAgentHost::GetOrCreateFor(inspected_web_contents)); | 92 // content::DevToolsAgentHost::GetOrCreateFor(inspected_web_contents)); |
| 93 // DevToolsWindow::ToggleDevToolsWindow( | 93 // DevToolsWindow::ToggleDevToolsWindow( |
| 94 // inspected_web_contents, DevToolsToggleAction::Show()); | 94 // inspected_web_contents, DevToolsToggleAction::Show()); |
| 95 // DevToolsWindow* window = DevToolsWindow::FindDevToolsWindow(agent.get()); | 95 // DevToolsWindow* window = DevToolsWindow::FindDevToolsWindow(agent.get()); |
| 96 // | 96 // |
| 97 static void ToggleDevToolsWindow( | 97 static void ToggleDevToolsWindow( |
| 98 Browser* browser, | 98 Browser* browser, |
| 99 const DevToolsToggleAction& action); | 99 const DevToolsToggleAction& action); |
| 100 | 100 |
| 101 // External frontend is always undocked. | |
| 102 static void OpenExternalFrontend( | |
| 103 Profile* profile, | |
| 104 const std::string& frontend_uri, | |
| 105 const scoped_refptr<content::DevToolsAgentHost>& agent_host, | |
| 106 bool is_worker, | |
| 107 bool is_v8_only); | |
| 108 | |
| 109 // Node frontend is always undocked. | 101 // Node frontend is always undocked. |
| 110 static void OpenNodeFrontendWindow(Profile* profile); | 102 static void OpenNodeFrontendWindow(Profile* profile); |
| 111 | 103 |
| 112 // Worker frontend is always undocked. | 104 // Worker frontend is always undocked. |
| 113 static void OpenDevToolsWindowForWorker( | 105 static void OpenDevToolsWindowForWorker( |
| 114 Profile* profile, | 106 Profile* profile, |
| 115 const scoped_refptr<content::DevToolsAgentHost>& worker_agent); | 107 const scoped_refptr<content::DevToolsAgentHost>& worker_agent); |
| 116 | 108 |
| 117 static void InspectElement(content::RenderFrameHost* inspected_frame_host, | 109 static void InspectElement(content::RenderFrameHost* inspected_frame_host, |
| 118 int x, | 110 int x, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // - CloseContents: destroys frontend; | 230 // - CloseContents: destroys frontend; |
| 239 // - DevToolsWindow is dead once it's main_web_contents dies. | 231 // - DevToolsWindow is dead once it's main_web_contents dies. |
| 240 enum LifeStage { | 232 enum LifeStage { |
| 241 kNotLoaded, | 233 kNotLoaded, |
| 242 kOnLoadFired, // Implies SetIsDocked was not yet called. | 234 kOnLoadFired, // Implies SetIsDocked was not yet called. |
| 243 kIsDockedSet, // Implies DocumentOnLoadCompleted was not yet called. | 235 kIsDockedSet, // Implies DocumentOnLoadCompleted was not yet called. |
| 244 kLoadCompleted, | 236 kLoadCompleted, |
| 245 kClosing | 237 kClosing |
| 246 }; | 238 }; |
| 247 | 239 |
| 240 enum FrontendType { |
| 241 kFrontendDefault, |
| 242 kFrontendRemote, |
| 243 kFrontendWorker, |
| 244 kFrontendV8, |
| 245 kFrontendNode |
| 246 }; |
| 247 |
| 248 DevToolsWindow(Profile* profile, | 248 DevToolsWindow(Profile* profile, |
| 249 content::WebContents* main_web_contents, | 249 content::WebContents* main_web_contents, |
| 250 DevToolsUIBindings* bindings, | 250 DevToolsUIBindings* bindings, |
| 251 content::WebContents* inspected_web_contents, | 251 content::WebContents* inspected_web_contents, |
| 252 bool can_dock); | 252 bool can_dock); |
| 253 | 253 |
| 254 // External frontend is always undocked. |
| 255 static void OpenExternalFrontend( |
| 256 Profile* profile, |
| 257 const std::string& frontend_uri, |
| 258 const scoped_refptr<content::DevToolsAgentHost>& agent_host, |
| 259 FrontendType frontend_type); |
| 260 |
| 254 static DevToolsWindow* Create(Profile* profile, | 261 static DevToolsWindow* Create(Profile* profile, |
| 255 content::WebContents* inspected_web_contents, | 262 content::WebContents* inspected_web_contents, |
| 256 bool shared_worker_frontend, | 263 FrontendType frontend_type, |
| 257 bool v8_only_frontend, | 264 const std::string& frontend_url, |
| 258 bool node_frontend, | |
| 259 const std::string& remote_frontend, | |
| 260 bool can_dock, | 265 bool can_dock, |
| 261 const std::string& settings, | 266 const std::string& settings, |
| 262 const std::string& panel); | 267 const std::string& panel); |
| 263 static GURL GetDevToolsURL(Profile* profile, | 268 static GURL GetDevToolsURL(Profile* profile, |
| 264 bool shared_worker_frontend, | 269 FrontendType frontend_type, |
| 265 bool v8_only_frontend, | 270 const std::string& frontend_url, |
| 266 bool node_frontend, | |
| 267 const std::string& remote_frontend, | |
| 268 bool can_dock, | 271 bool can_dock, |
| 269 const std::string& panel); | 272 const std::string& panel); |
| 270 | 273 |
| 271 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); | 274 static DevToolsWindow* CreateDevToolsWindowForWorker(Profile* profile); |
| 272 static void ToggleDevToolsWindow( | 275 static void ToggleDevToolsWindow( |
| 273 content::WebContents* web_contents, | 276 content::WebContents* web_contents, |
| 274 bool force_open, | 277 bool force_open, |
| 275 const DevToolsToggleAction& action, | 278 const DevToolsToggleAction& action, |
| 276 const std::string& settings); | 279 const std::string& settings); |
| 277 | 280 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 base::Closure ready_for_test_callback_; | 364 base::Closure ready_for_test_callback_; |
| 362 | 365 |
| 363 base::TimeTicks inspect_element_start_time_; | 366 base::TimeTicks inspect_element_start_time_; |
| 364 std::unique_ptr<DevToolsEventForwarder> event_forwarder_; | 367 std::unique_ptr<DevToolsEventForwarder> event_forwarder_; |
| 365 | 368 |
| 366 friend class DevToolsEventForwarder; | 369 friend class DevToolsEventForwarder; |
| 367 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); | 370 DISALLOW_COPY_AND_ASSIGN(DevToolsWindow); |
| 368 }; | 371 }; |
| 369 | 372 |
| 370 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ | 373 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_WINDOW_H_ |
| OLD | NEW |