| 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 "content/browser/devtools/devtools_http_handler_impl.h" | 5 #include "content/browser/devtools/devtools_http_handler_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 delegate_->EnumerateTargets( | 479 delegate_->EnumerateTargets( |
| 480 base::Bind(&DevToolsHttpHandlerImpl::OnTargetListReceived, | 480 base::Bind(&DevToolsHttpHandlerImpl::OnTargetListReceived, |
| 481 this, connection_id, host)); | 481 this, connection_id, host)); |
| 482 return; | 482 return; |
| 483 } | 483 } |
| 484 | 484 |
| 485 if (command == "new") { | 485 if (command == "new") { |
| 486 GURL url(net::UnescapeURLComponent( | 486 GURL url(net::UnescapeURLComponent( |
| 487 query, net::UnescapeRule::URL_SPECIAL_CHARS)); | 487 query, net::UnescapeRule::URL_SPECIAL_CHARS)); |
| 488 if (!url.is_valid()) | 488 if (!url.is_valid()) |
| 489 url = GURL(kAboutBlankURL); | 489 url = GURL(url::kAboutBlankURL); |
| 490 scoped_ptr<DevToolsTarget> target(delegate_->CreateNewTarget(url)); | 490 scoped_ptr<DevToolsTarget> target(delegate_->CreateNewTarget(url)); |
| 491 if (!target) { | 491 if (!target) { |
| 492 SendJson(connection_id, | 492 SendJson(connection_id, |
| 493 net::HTTP_INTERNAL_SERVER_ERROR, | 493 net::HTTP_INTERNAL_SERVER_ERROR, |
| 494 NULL, | 494 NULL, |
| 495 "Could not create new page"); | 495 "Could not create new page"); |
| 496 return; | 496 return; |
| 497 } | 497 } |
| 498 std::string host = info.headers["host"]; | 498 std::string host = info.headers["host"]; |
| 499 scoped_ptr<base::DictionaryValue> dictionary( | 499 scoped_ptr<base::DictionaryValue> dictionary( |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 id.c_str(), | 816 id.c_str(), |
| 817 host); | 817 host); |
| 818 dictionary->SetString( | 818 dictionary->SetString( |
| 819 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 819 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
| 820 } | 820 } |
| 821 | 821 |
| 822 return dictionary; | 822 return dictionary; |
| 823 } | 823 } |
| 824 | 824 |
| 825 } // namespace content | 825 } // namespace content |
| OLD | NEW |