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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 delegate_->EnumerateTargets( | 472 delegate_->EnumerateTargets( |
473 base::Bind(&DevToolsHttpHandlerImpl::OnTargetListReceived, | 473 base::Bind(&DevToolsHttpHandlerImpl::OnTargetListReceived, |
474 this, connection_id, host)); | 474 this, connection_id, host)); |
475 return; | 475 return; |
476 } | 476 } |
477 | 477 |
478 if (command == "new") { | 478 if (command == "new") { |
479 GURL url(net::UnescapeURLComponent( | 479 GURL url(net::UnescapeURLComponent( |
480 query, net::UnescapeRule::URL_SPECIAL_CHARS)); | 480 query, net::UnescapeRule::URL_SPECIAL_CHARS)); |
481 if (!url.is_valid()) | 481 if (!url.is_valid()) |
482 url = GURL(kAboutBlankURL); | 482 url = GURL(url::kAboutBlankURL); |
483 scoped_ptr<DevToolsTarget> target(delegate_->CreateNewTarget(url)); | 483 scoped_ptr<DevToolsTarget> target(delegate_->CreateNewTarget(url)); |
484 if (!target) { | 484 if (!target) { |
485 SendJson(connection_id, | 485 SendJson(connection_id, |
486 net::HTTP_INTERNAL_SERVER_ERROR, | 486 net::HTTP_INTERNAL_SERVER_ERROR, |
487 NULL, | 487 NULL, |
488 "Could not create new page"); | 488 "Could not create new page"); |
489 return; | 489 return; |
490 } | 490 } |
491 std::string host = info.headers["host"]; | 491 std::string host = info.headers["host"]; |
492 scoped_ptr<base::DictionaryValue> dictionary( | 492 scoped_ptr<base::DictionaryValue> dictionary( |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 id.c_str(), | 784 id.c_str(), |
785 host); | 785 host); |
786 dictionary->SetString( | 786 dictionary->SetString( |
787 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 787 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
788 } | 788 } |
789 | 789 |
790 return dictionary; | 790 return dictionary; |
791 } | 791 } |
792 | 792 |
793 } // namespace content | 793 } // namespace content |
OLD | NEW |