| 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 13 matching lines...) Expand all Loading... |
| 24 #include "content/browser/devtools/tethering_handler.h" | 24 #include "content/browser/devtools/tethering_handler.h" |
| 25 #include "content/common/devtools_messages.h" | 25 #include "content/common/devtools_messages.h" |
| 26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 27 #include "content/public/browser/devtools_agent_host.h" | 27 #include "content/public/browser/devtools_agent_host.h" |
| 28 #include "content/public/browser/devtools_client_host.h" | 28 #include "content/public/browser/devtools_client_host.h" |
| 29 #include "content/public/browser/devtools_http_handler_delegate.h" | 29 #include "content/public/browser/devtools_http_handler_delegate.h" |
| 30 #include "content/public/browser/devtools_manager.h" | 30 #include "content/public/browser/devtools_manager.h" |
| 31 #include "content/public/browser/devtools_target.h" | 31 #include "content/public/browser/devtools_target.h" |
| 32 #include "content/public/common/content_client.h" | 32 #include "content/public/common/content_client.h" |
| 33 #include "content/public/common/url_constants.h" | 33 #include "content/public/common/url_constants.h" |
| 34 #include "content/public/common/user_agent.h" |
| 35 #include "content/public/common/user_agent.h" |
| 34 #include "grit/devtools_resources_map.h" | 36 #include "grit/devtools_resources_map.h" |
| 35 #include "net/base/escape.h" | 37 #include "net/base/escape.h" |
| 36 #include "net/base/io_buffer.h" | 38 #include "net/base/io_buffer.h" |
| 37 #include "net/base/ip_endpoint.h" | 39 #include "net/base/ip_endpoint.h" |
| 38 #include "net/server/http_server_request_info.h" | 40 #include "net/server/http_server_request_info.h" |
| 39 #include "net/server/http_server_response_info.h" | 41 #include "net/server/http_server_response_info.h" |
| 40 #include "webkit/common/user_agent/user_agent_util.h" | |
| 41 | 42 |
| 42 #if defined(OS_ANDROID) | 43 #if defined(OS_ANDROID) |
| 43 #include "base/android/build_info.h" | 44 #include "base/android/build_info.h" |
| 44 #endif | 45 #endif |
| 45 | 46 |
| 46 namespace content { | 47 namespace content { |
| 47 | 48 |
| 48 namespace { | 49 namespace { |
| 49 | 50 |
| 50 const char kProtocolVersion[] = "1.0"; | 51 const char kProtocolVersion[] = "1.0"; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 SendJson(connection_id, | 446 SendJson(connection_id, |
| 446 net::HTTP_NOT_FOUND, | 447 net::HTTP_NOT_FOUND, |
| 447 NULL, | 448 NULL, |
| 448 "Malformed query: " + info.path); | 449 "Malformed query: " + info.path); |
| 449 return; | 450 return; |
| 450 } | 451 } |
| 451 | 452 |
| 452 if (command == "version") { | 453 if (command == "version") { |
| 453 base::DictionaryValue version; | 454 base::DictionaryValue version; |
| 454 version.SetString("Protocol-Version", kProtocolVersion); | 455 version.SetString("Protocol-Version", kProtocolVersion); |
| 455 version.SetString("WebKit-Version", webkit_glue::GetWebKitVersion()); | 456 version.SetString("WebKit-Version", GetWebKitVersion()); |
| 456 version.SetString("Browser", GetContentClient()->GetProduct()); | 457 version.SetString("Browser", GetContentClient()->GetProduct()); |
| 457 version.SetString("User-Agent", GetContentClient()->GetUserAgent()); | 458 version.SetString("User-Agent", GetContentClient()->GetUserAgent()); |
| 458 #if defined(OS_ANDROID) | 459 #if defined(OS_ANDROID) |
| 459 version.SetString("Android-Package", | 460 version.SetString("Android-Package", |
| 460 base::android::BuildInfo::GetInstance()->package_name()); | 461 base::android::BuildInfo::GetInstance()->package_name()); |
| 461 #endif | 462 #endif |
| 462 SendJson(connection_id, net::HTTP_OK, &version, std::string()); | 463 SendJson(connection_id, net::HTTP_OK, &version, std::string()); |
| 463 return; | 464 return; |
| 464 } | 465 } |
| 465 | 466 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 id.c_str(), | 779 id.c_str(), |
| 779 host); | 780 host); |
| 780 dictionary->SetString( | 781 dictionary->SetString( |
| 781 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 782 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
| 782 } | 783 } |
| 783 | 784 |
| 784 return dictionary; | 785 return dictionary; |
| 785 } | 786 } |
| 786 | 787 |
| 787 } // namespace content | 788 } // namespace content |
| OLD | NEW |