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 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 return std::find(schemes.begin(), schemes.end(), scheme) != schemes.end(); | 60 return std::find(schemes.begin(), schemes.end(), scheme) != schemes.end(); |
61 } | 61 } |
62 | 62 |
63 // Parse a URL into the components used to resolve its request. |source_name| | 63 // Parse a URL into the components used to resolve its request. |source_name| |
64 // is the hostname and |path| is the remaining portion of the URL. | 64 // is the hostname and |path| is the remaining portion of the URL. |
65 void URLToRequest(const GURL& url, std::string* source_name, | 65 void URLToRequest(const GURL& url, std::string* source_name, |
66 std::string* path) { | 66 std::string* path) { |
67 std::vector<std::string> additional_schemes; | 67 std::vector<std::string> additional_schemes; |
68 DCHECK(url.SchemeIs(chrome::kChromeDevToolsScheme) || | 68 DCHECK(url.SchemeIs(chrome::kChromeDevToolsScheme) || |
69 url.SchemeIs(chrome::kChromeUIScheme) || | 69 url.SchemeIs(chrome::kChromeUIScheme) || |
| 70 url.SchemeIs(chrome::kDomDistillerScheme) || |
70 (GetContentClient()->browser()->GetAdditionalWebUISchemes( | 71 (GetContentClient()->browser()->GetAdditionalWebUISchemes( |
71 &additional_schemes), | 72 &additional_schemes), |
72 SchemeIsInSchemes(url.scheme(), additional_schemes))); | 73 SchemeIsInSchemes(url.scheme(), additional_schemes))); |
73 | 74 |
74 if (!url.is_valid()) { | 75 if (!url.is_valid()) { |
75 NOTREACHED(); | 76 NOTREACHED(); |
76 return; | 77 return; |
77 } | 78 } |
78 | 79 |
79 // Our input looks like: chrome://source_name/extra_bits?foo . | 80 // Our input looks like: chrome://source_name/extra_bits?foo . |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 665 |
665 } // namespace | 666 } // namespace |
666 | 667 |
667 net::URLRequestJobFactory::ProtocolHandler* | 668 net::URLRequestJobFactory::ProtocolHandler* |
668 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, | 669 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, |
669 bool is_incognito) { | 670 bool is_incognito) { |
670 return new DevToolsJobFactory(resource_context, is_incognito); | 671 return new DevToolsJobFactory(resource_context, is_incognito); |
671 } | 672 } |
672 | 673 |
673 } // namespace content | 674 } // namespace content |
OLD | NEW |