Chromium Code Reviews| Index: chrome/browser/devtools/devtools_window.cc |
| diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc |
| index a57699c5970342a063109b58e69e700965453b58..98458afc0fb9c8b7a15f5236428f2c32d495587e 100644 |
| --- a/chrome/browser/devtools/devtools_window.cc |
| +++ b/chrome/browser/devtools/devtools_window.cc |
| @@ -303,7 +303,8 @@ DevToolsWindow* DevToolsWindow::OpenDevToolsWindowForWorker( |
| DevToolsAgentHost* worker_agent) { |
| DevToolsWindow* window = FindDevToolsWindow(worker_agent); |
| if (!window) { |
| - window = DevToolsWindow::CreateDevToolsWindowForWorker(profile); |
| + window = DevToolsWindow::CreateDevToolsWindowForWorker( |
| + profile, worker_agent->IsWorkerPaused()); |
| // Will disconnect the current client host if there is one. |
| content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( |
| worker_agent, window->bindings_->frontend_host()); |
| @@ -314,9 +315,10 @@ DevToolsWindow* DevToolsWindow::OpenDevToolsWindowForWorker( |
| // static |
| DevToolsWindow* DevToolsWindow::CreateDevToolsWindowForWorker( |
| - Profile* profile) { |
| + Profile* profile, |
| + bool worker_paused) { |
| content::RecordAction(base::UserMetricsAction("DevTools_InspectWorker")); |
| - return Create(profile, GURL(), NULL, true, false, false); |
| + return Create(profile, GURL(), NULL, true, worker_paused, false, false); |
| } |
| // static |
| @@ -374,8 +376,13 @@ void DevToolsWindow::OpenExternalFrontend( |
| content::DevToolsAgentHost* agent_host) { |
| DevToolsWindow* window = FindDevToolsWindow(agent_host); |
| if (!window) { |
| - window = Create(profile, DevToolsUI::GetProxyURL(frontend_url), NULL, |
| - false, true, false); |
| + window = Create(profile, |
| + DevToolsUI::GetProxyURL(frontend_url), |
| + NULL, |
| + false, |
| + false, |
| + true, |
| + false); |
| content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor( |
| agent_host, window->bindings_->frontend_host()); |
| } |
| @@ -397,7 +404,7 @@ DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow( |
| inspected_rvh->GetProcess()->GetBrowserContext()); |
| content::RecordAction( |
| base::UserMetricsAction("DevTools_InspectRenderer")); |
| - window = Create(profile, GURL(), inspected_rvh, false, false, true); |
| + window = Create(profile, GURL(), inspected_rvh, false, false, false, true); |
| manager->RegisterDevToolsClientHostFor(agent.get(), |
| window->bindings_->frontend_host()); |
| do_open = true; |
| @@ -622,13 +629,13 @@ DevToolsWindow::DevToolsWindow(Profile* profile, |
| } |
| // static |
| -DevToolsWindow* DevToolsWindow::Create( |
| - Profile* profile, |
| - const GURL& frontend_url, |
| - content::RenderViewHost* inspected_rvh, |
| - bool shared_worker_frontend, |
| - bool external_frontend, |
| - bool can_dock) { |
| +DevToolsWindow* DevToolsWindow::Create(Profile* profile, |
| + const GURL& frontend_url, |
| + content::RenderViewHost* inspected_rvh, |
| + bool shared_worker_frontend, |
| + bool worker_paused, |
|
pfeldman
2014/05/20 19:20:41
we should not pass state or capabilities-related p
|
| + bool external_frontend, |
| + bool can_dock) { |
| if (inspected_rvh) { |
| // Check for a place to dock. |
| Browser* browser = NULL; |
| @@ -644,8 +651,10 @@ DevToolsWindow* DevToolsWindow::Create( |
| } |
| // Create WebContents with devtools. |
| - GURL url(GetDevToolsURL(profile, frontend_url, |
| + GURL url(GetDevToolsURL(profile, |
| + frontend_url, |
| shared_worker_frontend, |
| + worker_paused, |
| external_frontend, |
| can_dock)); |
| return new DevToolsWindow(profile, url, inspected_rvh, can_dock); |
| @@ -655,6 +664,7 @@ DevToolsWindow* DevToolsWindow::Create( |
| GURL DevToolsWindow::GetDevToolsURL(Profile* profile, |
| const GURL& base_url, |
| bool shared_worker_frontend, |
| + bool worker_paused, |
| bool external_frontend, |
| bool can_dock) { |
| // Compatibility errors are encoded with data urls, pass them |
| @@ -669,6 +679,8 @@ GURL DevToolsWindow::GetDevToolsURL(Profile* profile, |
| ((frontend_url.find("?") == std::string::npos) ? "?" : "&")); |
| if (shared_worker_frontend) |
| url_string += "&isSharedWorker=true"; |
| + if (worker_paused) |
| + url_string += "&workerPaused=true"; |
| if (external_frontend) |
| url_string += "&remoteFrontend=true"; |
| if (can_dock) |