Index: components/dom_distiller/content/dom_distiller_viewer_source.cc |
diff --git a/components/dom_distiller/content/dom_distiller_viewer_source.cc b/components/dom_distiller/content/dom_distiller_viewer_source.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..48961f699dc7ab5318824238178ec0a88ea1431c |
--- /dev/null |
+++ b/components/dom_distiller/content/dom_distiller_viewer_source.cc |
@@ -0,0 +1,48 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/dom_distiller/content/dom_distiller_viewer_source.h" |
+ |
+#include <string> |
+ |
+#include "base/memory/ref_counted_memory.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "content/public/common/url_constants.h" |
+#include "net/url_request/url_request.h" |
+#include "url/gurl.h" |
+ |
+namespace dom_distiller { |
+ |
+DomDistillerViewerSource::DomDistillerViewerSource() {} |
+ |
+DomDistillerViewerSource::~DomDistillerViewerSource() {} |
+ |
+std::string DomDistillerViewerSource::GetSource() const { |
+ return chrome::kDomDistillerScheme; |
+} |
+ |
+void DomDistillerViewerSource::StartDataRequest( |
+ const std::string& path, |
+ int render_process_id, |
+ int render_view_id, |
+ const content::URLDataSource::GotDataCallback& callback) { |
+ std::string page_template = "Aloha!"; |
+ callback.Run(base::RefCountedString::TakeString(&page_template)); |
+}; |
+ |
+std::string DomDistillerViewerSource::GetMimeType( |
+ const std::string& path) const { |
+ return "text/html"; |
+} |
+ |
+bool DomDistillerViewerSource::ShouldServiceRequest( |
+ const net::URLRequest* request) const { |
+ return request->url().SchemeIs(chrome::kDomDistillerScheme); |
+} |
+ |
+std::string DomDistillerViewerSource::GetContentSecurityPolicyFrameSrc() const { |
+ return "frame-src none;"; |
+} |
+ |
+} // namespace dom_distiller |