OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/dom_distiller/content/browser/dom_distiller_viewer_source.h
" | 5 #include "components/dom_distiller/content/browser/dom_distiller_viewer_source.h
" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 const std::string& path) const { | 283 const std::string& path) const { |
284 if (kViewerCssPath == path) { | 284 if (kViewerCssPath == path) { |
285 return "text/css"; | 285 return "text/css"; |
286 } else if (kViewerLoadingImagePath == path) { | 286 } else if (kViewerLoadingImagePath == path) { |
287 return "image/svg+xml"; | 287 return "image/svg+xml"; |
288 } | 288 } |
289 return "text/html"; | 289 return "text/html"; |
290 } | 290 } |
291 | 291 |
292 bool DomDistillerViewerSource::ShouldServiceRequest( | 292 bool DomDistillerViewerSource::ShouldServiceRequest( |
293 const net::URLRequest* request) const { | 293 const GURL& url, |
294 return request->url().SchemeIs(scheme_); | 294 content::ResourceContext* resource_context, |
295 } | 295 int render_process_id) const { |
296 | 296 return url.SchemeIs(scheme_); |
297 // TODO(nyquist): Start tracking requests using this method. | |
298 void DomDistillerViewerSource::WillServiceRequest( | |
299 const net::URLRequest* request, | |
300 std::string* path) const { | |
301 } | 297 } |
302 | 298 |
303 std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc() | 299 std::string DomDistillerViewerSource::GetContentSecurityPolicyStyleSrc() |
304 const { | 300 const { |
305 return "style-src 'self' https://fonts.googleapis.com;"; | 301 return "style-src 'self' https://fonts.googleapis.com;"; |
306 } | 302 } |
307 | 303 |
308 std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const { | 304 std::string DomDistillerViewerSource::GetContentSecurityPolicyChildSrc() const { |
309 return "child-src *;"; | 305 return "child-src *;"; |
310 } | 306 } |
311 | 307 |
312 } // namespace dom_distiller | 308 } // namespace dom_distiller |
OLD | NEW |