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

Unified Diff: components/dom_distiller/content/dom_distiller_viewer_source.h

Issue 151003006: Add support for distilling arbitrary URLs in DOM Distiller Viewer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added new strings to iOS whitelist Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/dom_distiller/DEPS ('k') | components/dom_distiller/content/dom_distiller_viewer_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/content/dom_distiller_viewer_source.h
diff --git a/components/dom_distiller/content/dom_distiller_viewer_source.h b/components/dom_distiller/content/dom_distiller_viewer_source.h
index eb7559bc20ae18527d94e21e3001ce05809e8cf6..237389361ef3e0fcb1fce12396921bdb351f30a5 100644
--- a/components/dom_distiller/content/dom_distiller_viewer_source.h
+++ b/components/dom_distiller/content/dom_distiller_viewer_source.h
@@ -11,16 +11,20 @@
namespace dom_distiller {
-class DomDistillerService;
+class DomDistillerServiceInterface;
+class DomDistillerViewerSourceTest;
+class ViewerHandle;
+class ViewRequestDelegate;
// Serves HTML and resources for viewing distilled articles.
class DomDistillerViewerSource : public content::URLDataSource {
public:
- DomDistillerViewerSource(DomDistillerService* dom_distiller_service,
+ DomDistillerViewerSource(DomDistillerServiceInterface* dom_distiller_service,
const std::string& scheme);
virtual ~DomDistillerViewerSource();
- private:
+ class RequestViewerHandle;
+
// Overridden from content::URLDataSource:
virtual std::string GetSource() const OVERRIDE;
virtual void StartDataRequest(
@@ -29,18 +33,27 @@ class DomDistillerViewerSource : public content::URLDataSource {
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
virtual std::string GetMimeType(const std::string& path) const OVERRIDE;
- virtual bool ShouldServiceRequest(const net::URLRequest* request)
- const OVERRIDE;
+ virtual bool ShouldServiceRequest(const net::URLRequest* request) const
+ OVERRIDE;
virtual void WillServiceRequest(const net::URLRequest* request,
std::string* path) const OVERRIDE;
virtual std::string GetContentSecurityPolicyObjectSrc() const OVERRIDE;
+ private:
+ friend class DomDistillerViewerSourceTest;
+
+ // Based on the given path, calls into the DomDistillerServiceInterface for
+ // viewing distilled content based on the |path|.
+ scoped_ptr<ViewerHandle> CreateViewRequest(
+ const std::string& path,
+ ViewRequestDelegate* view_request_delegate);
+
// The scheme this URLDataSource is hosted under.
std::string scheme_;
// The service which contains all the functionality needed to interact with
// the list of articles.
- DomDistillerService* dom_distiller_service_;
+ DomDistillerServiceInterface* dom_distiller_service_;
DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource);
};
« no previous file with comments | « components/dom_distiller/DEPS ('k') | components/dom_distiller/content/dom_distiller_viewer_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698