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

Side by Side Diff: components/dom_distiller/content/dom_distiller_viewer_source.h

Issue 134873008: Add support for displaying distilled articles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added browser test for looking up articles, and fixed rebase of MIME-type 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "content/public/browser/url_data_source.h" 10 #include "content/public/browser/url_data_source.h"
11 11
12 namespace dom_distiller { 12 namespace dom_distiller {
13 13
14 class DomDistillerService;
15
14 // Serves HTML and resources for viewing distilled articles. 16 // Serves HTML and resources for viewing distilled articles.
15 class DomDistillerViewerSource : public content::URLDataSource { 17 class DomDistillerViewerSource : public content::URLDataSource {
16 public: 18 public:
17 DomDistillerViewerSource(const std::string& scheme); 19 DomDistillerViewerSource(DomDistillerService* dom_distiller_service,
20 const std::string& scheme);
21 virtual ~DomDistillerViewerSource();
18 22
19 private: 23 private:
20 virtual ~DomDistillerViewerSource();
21
22 // Overridden from content::URLDataSource: 24 // Overridden from content::URLDataSource:
23 virtual std::string GetSource() const OVERRIDE; 25 virtual std::string GetSource() const OVERRIDE;
24 virtual void StartDataRequest( 26 virtual void StartDataRequest(
25 const std::string& path, 27 const std::string& path,
26 int render_process_id, 28 int render_process_id,
27 int render_frame_id, 29 int render_frame_id,
28 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; 30 const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
29 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; 31 virtual std::string GetMimeType(const std::string& path) const OVERRIDE;
30 virtual bool ShouldServiceRequest( 32 virtual bool ShouldServiceRequest(const net::URLRequest* request)
31 const net::URLRequest* request) const OVERRIDE; 33 const OVERRIDE;
34 virtual void WillServiceRequest(const net::URLRequest* request,
35 std::string* path) const OVERRIDE;
32 36
33 // The scheme this URLDataSource is hosted under. 37 // The scheme this URLDataSource is hosted under.
34 std::string scheme_; 38 std::string scheme_;
35 39
40 // The service which contains all the functionality needed to interact with
41 // the list of articles.
42 DomDistillerService* dom_distiller_service_;
43
36 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); 44 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource);
37 }; 45 };
38 46
39 } // namespace dom_distiller 47 } // namespace dom_distiller
40 48
41 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ 49 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698