Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Side by Side Diff: content/browser/devtools/devtools_http_handler_impl.cc

Issue 191093002: Simplify the user agent code some more since after r255534 it's not affected by the site's URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: patchset 15 which works Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 19 matching lines...) Expand all
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 "grit/devtools_resources_map.h" 34 #include "grit/devtools_resources_map.h"
35 #include "net/base/escape.h" 35 #include "net/base/escape.h"
36 #include "net/base/io_buffer.h" 36 #include "net/base/io_buffer.h"
37 #include "net/base/ip_endpoint.h" 37 #include "net/base/ip_endpoint.h"
38 #include "net/server/http_server_request_info.h" 38 #include "net/server/http_server_request_info.h"
39 #include "net/server/http_server_response_info.h" 39 #include "net/server/http_server_response_info.h"
40 #include "webkit/common/user_agent/user_agent.h"
41 #include "webkit/common/user_agent/user_agent_util.h" 40 #include "webkit/common/user_agent/user_agent_util.h"
42 41
43 #if defined(OS_ANDROID) 42 #if defined(OS_ANDROID)
44 #include "base/android/build_info.h" 43 #include "base/android/build_info.h"
45 #endif 44 #endif
46 45
47 namespace content { 46 namespace content {
48 47
49 namespace { 48 namespace {
50 49
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 net::HTTP_NOT_FOUND, 446 net::HTTP_NOT_FOUND,
448 NULL, 447 NULL,
449 "Malformed query: " + info.path); 448 "Malformed query: " + info.path);
450 return; 449 return;
451 } 450 }
452 451
453 if (command == "version") { 452 if (command == "version") {
454 base::DictionaryValue version; 453 base::DictionaryValue version;
455 version.SetString("Protocol-Version", kProtocolVersion); 454 version.SetString("Protocol-Version", kProtocolVersion);
456 version.SetString("WebKit-Version", webkit_glue::GetWebKitVersion()); 455 version.SetString("WebKit-Version", webkit_glue::GetWebKitVersion());
457 version.SetString("Browser", content::GetContentClient()->GetProduct()); 456 version.SetString("Browser", GetContentClient()->GetProduct());
458 version.SetString("User-Agent", 457 version.SetString("User-Agent", GetContentClient()->GetUserAgent());
459 webkit_glue::GetUserAgent(GURL(kAboutBlankURL)));
460 #if defined(OS_ANDROID) 458 #if defined(OS_ANDROID)
461 version.SetString("Android-Package", 459 version.SetString("Android-Package",
462 base::android::BuildInfo::GetInstance()->package_name()); 460 base::android::BuildInfo::GetInstance()->package_name());
463 #endif 461 #endif
464 SendJson(connection_id, net::HTTP_OK, &version, std::string()); 462 SendJson(connection_id, net::HTTP_OK, &version, std::string());
465 return; 463 return;
466 } 464 }
467 465
468 if (command == "list") { 466 if (command == "list") {
469 std::string host = info.headers["host"]; 467 std::string host = info.headers["host"];
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 id.c_str(), 778 id.c_str(),
781 host); 779 host);
782 dictionary->SetString( 780 dictionary->SetString(
783 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); 781 kTargetDevtoolsFrontendUrlField, devtools_frontend_url);
784 } 782 }
785 783
786 return dictionary; 784 return dictionary;
787 } 785 }
788 786
789 } // namespace content 787 } // namespace content
OLDNEW
« no previous file with comments | « content/app/content_main_runner.cc ('k') | content/browser/media/android/browser_media_player_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698