| 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/ui/webui/inspect_ui.h" | 5 #include "chrome/browser/ui/webui/inspect_ui.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/devtools/devtools_target_impl.h" | 9 #include "chrome/browser/devtools/devtools_target_impl.h" |
| 10 #include "chrome/browser/devtools/devtools_targets_ui.h" | 10 #include "chrome/browser/devtools/devtools_targets_ui.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // Fetch agent host from remote browser. | 276 // Fetch agent host from remote browser. |
| 277 scoped_refptr<content::DevToolsAgentHost> agent_host = | 277 scoped_refptr<content::DevToolsAgentHost> agent_host = |
| 278 handler->GetBrowserAgentHost(browser_id); | 278 handler->GetBrowserAgentHost(browser_id); |
| 279 if (agent_host->IsAttached()) | 279 if (agent_host->IsAttached()) |
| 280 return; | 280 return; |
| 281 | 281 |
| 282 // Create web contents for the front-end. | 282 // Create web contents for the front-end. |
| 283 WebContents* inspect_ui = web_ui()->GetWebContents(); | 283 WebContents* inspect_ui = web_ui()->GetWebContents(); |
| 284 WebContents* front_end = inspect_ui->GetDelegate()->OpenURLFromTab( | 284 WebContents* front_end = inspect_ui->GetDelegate()->OpenURLFromTab( |
| 285 inspect_ui, | 285 inspect_ui, |
| 286 content::OpenURLParams(GURL(content::kAboutBlankURL), | 286 content::OpenURLParams(GURL(url::kAboutBlankURL), |
| 287 content::Referrer(), | 287 content::Referrer(), |
| 288 NEW_FOREGROUND_TAB, | 288 NEW_FOREGROUND_TAB, |
| 289 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 289 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 290 false)); | 290 false)); |
| 291 | 291 |
| 292 // Install devtools bindings. | 292 // Install devtools bindings. |
| 293 DevToolsUIBindings* bindings = new DevToolsUIBindings(front_end, | 293 DevToolsUIBindings* bindings = new DevToolsUIBindings(front_end, |
| 294 frontend_url); | 294 frontend_url); |
| 295 | 295 |
| 296 // Engage remote debugging between front-end and agent host. | 296 // Engage remote debugging between front-end and agent host. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 scoped_ptr<base::Value> source_value(base::Value::CreateStringValue(source)); | 476 scoped_ptr<base::Value> source_value(base::Value::CreateStringValue(source)); |
| 477 web_ui()->CallJavascriptFunction( | 477 web_ui()->CallJavascriptFunction( |
| 478 "populateTargets", | 478 "populateTargets", |
| 479 *source_value.get(), | 479 *source_value.get(), |
| 480 *targets.get()); | 480 *targets.get()); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void InspectUI::PopulatePortStatus(const base::Value& status) { | 483 void InspectUI::PopulatePortStatus(const base::Value& status) { |
| 484 web_ui()->CallJavascriptFunction("populatePortStatus", status); | 484 web_ui()->CallJavascriptFunction("populatePortStatus", status); |
| 485 } | 485 } |
| OLD | NEW |