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..a09a04d1fe9ba5cb39bc77962778fe6705514d91 100644 |
--- a/components/dom_distiller/content/dom_distiller_viewer_source.h |
+++ b/components/dom_distiller/content/dom_distiller_viewer_source.h |
@@ -7,20 +7,25 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
+#include "base/gtest_prod_util.h" |
shashi
2014/02/27 04:29:08
nit: is this import needed?
|
#include "content/public/browser/url_data_source.h" |
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 +34,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 either based on the URL or the entry ID. |
shashi
2014/02/27 04:29:08
nit: Do you mean: Based on the |path|
nyquist
2014/02/27 19:50:19
Done.
|
+ 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); |
}; |