| 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 #include "chrome/browser/devtools/devtools_window.h" | 5 #include "chrome/browser/devtools/devtools_window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 return ToggleDevToolsWindow( | 463 return ToggleDevToolsWindow( |
| 464 browser->tab_strip_model()->GetActiveWebContents(), | 464 browser->tab_strip_model()->GetActiveWebContents(), |
| 465 action.type() == DevToolsToggleAction::kInspect, | 465 action.type() == DevToolsToggleAction::kInspect, |
| 466 action, ""); | 466 action, ""); |
| 467 } | 467 } |
| 468 | 468 |
| 469 // static | 469 // static |
| 470 void DevToolsWindow::OpenExternalFrontend( | 470 void DevToolsWindow::OpenExternalFrontend( |
| 471 Profile* profile, | 471 Profile* profile, |
| 472 const std::string& frontend_url, | 472 const std::string& frontend_url, |
| 473 content::DevToolsAgentHost* agent_host) { | 473 content::DevToolsAgentHost* agent_host, |
| 474 bool isWorker) { |
| 474 DevToolsWindow* window = FindDevToolsWindow(agent_host); | 475 DevToolsWindow* window = FindDevToolsWindow(agent_host); |
| 475 if (!window) { | 476 if (!window) { |
| 476 window = Create(profile, DevToolsUI::GetProxyURL(frontend_url), NULL, | 477 window = Create(profile, DevToolsUI::GetProxyURL(frontend_url), NULL, |
| 477 false, true, false, ""); | 478 isWorker, true, false, ""); |
| 478 window->bindings_->AttachTo(agent_host); | 479 window->bindings_->AttachTo(agent_host); |
| 479 } | 480 } |
| 480 window->ScheduleShow(DevToolsToggleAction::Show()); | 481 window->ScheduleShow(DevToolsToggleAction::Show()); |
| 481 } | 482 } |
| 482 | 483 |
| 483 // static | 484 // static |
| 484 DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow( | 485 DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow( |
| 485 content::WebContents* inspected_web_contents, | 486 content::WebContents* inspected_web_contents, |
| 486 bool force_open, | 487 bool force_open, |
| 487 const DevToolsToggleAction& action, | 488 const DevToolsToggleAction& action, |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 closure.Run(); | 1236 closure.Run(); |
| 1236 return; | 1237 return; |
| 1237 } | 1238 } |
| 1238 load_completed_callback_ = closure; | 1239 load_completed_callback_ = closure; |
| 1239 } | 1240 } |
| 1240 | 1241 |
| 1241 bool DevToolsWindow::ForwardKeyboardEvent( | 1242 bool DevToolsWindow::ForwardKeyboardEvent( |
| 1242 const content::NativeWebKeyboardEvent& event) { | 1243 const content::NativeWebKeyboardEvent& event) { |
| 1243 return event_forwarder_->ForwardEvent(event); | 1244 return event_forwarder_->ForwardEvent(event); |
| 1244 } | 1245 } |
| OLD | NEW |