| 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/webui/url_data_manager_backend.h" | 5 #include "content/browser/webui/url_data_manager_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 std::string* path) { | 693 std::string* path) { |
| 694 const std::string& spec = url.possibly_invalid_spec(); | 694 const std::string& spec = url.possibly_invalid_spec(); |
| 695 const url::Parsed& parsed = url.parsed_for_possibly_invalid_spec(); | 695 const url::Parsed& parsed = url.parsed_for_possibly_invalid_spec(); |
| 696 // + 1 to skip the slash at the beginning of the path. | 696 // + 1 to skip the slash at the beginning of the path. |
| 697 int offset = parsed.CountCharactersBefore(url::Parsed::PATH, false) + 1; | 697 int offset = parsed.CountCharactersBefore(url::Parsed::PATH, false) + 1; |
| 698 | 698 |
| 699 if (offset < static_cast<int>(spec.size())) | 699 if (offset < static_cast<int>(spec.size())) |
| 700 path->assign(spec.substr(offset)); | 700 path->assign(spec.substr(offset)); |
| 701 } | 701 } |
| 702 | 702 |
| 703 std::vector<std::string> URLDataManagerBackend::GetWebUISchemes() { |
| 704 std::vector<std::string> schemes; |
| 705 schemes.push_back(kChromeUIScheme); |
| 706 GetContentClient()->browser()->GetAdditionalWebUISchemes(&schemes); |
| 707 return schemes; |
| 708 } |
| 709 |
| 703 namespace { | 710 namespace { |
| 704 | 711 |
| 705 class DevToolsJobFactory | 712 class DevToolsJobFactory |
| 706 : public net::URLRequestJobFactory::ProtocolHandler { | 713 : public net::URLRequestJobFactory::ProtocolHandler { |
| 707 public: | 714 public: |
| 708 explicit DevToolsJobFactory(ResourceContext* resource_context); | 715 explicit DevToolsJobFactory(ResourceContext* resource_context); |
| 709 ~DevToolsJobFactory() override; | 716 ~DevToolsJobFactory() override; |
| 710 | 717 |
| 711 net::URLRequestJob* MaybeCreateJob( | 718 net::URLRequestJob* MaybeCreateJob( |
| 712 net::URLRequest* request, | 719 net::URLRequest* request, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 736 } | 743 } |
| 737 | 744 |
| 738 } // namespace | 745 } // namespace |
| 739 | 746 |
| 740 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( | 747 net::URLRequestJobFactory::ProtocolHandler* CreateDevToolsProtocolHandler( |
| 741 ResourceContext* resource_context) { | 748 ResourceContext* resource_context) { |
| 742 return new DevToolsJobFactory(resource_context); | 749 return new DevToolsJobFactory(resource_context); |
| 743 } | 750 } |
| 744 | 751 |
| 745 } // namespace content | 752 } // namespace content |
| OLD | NEW |