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

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

Issue 2856093004: Generalize content::URLDataSource so that it can be used by the network service. (Closed)
Patch Set: Created 3 years, 7 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
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_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_H_
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_H_ 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 class RequestViewerHandle; 29 class RequestViewerHandle;
30 30
31 // Overridden from content::URLDataSource: 31 // Overridden from content::URLDataSource:
32 std::string GetSource() const override; 32 std::string GetSource() const override;
33 void StartDataRequest( 33 void StartDataRequest(
34 const std::string& path, 34 const std::string& path,
35 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 35 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
36 const content::URLDataSource::GotDataCallback& callback) override; 36 const content::URLDataSource::GotDataCallback& callback) override;
37 std::string GetMimeType(const std::string& path) const override; 37 std::string GetMimeType(const std::string& path) const override;
38 bool ShouldServiceRequest(const net::URLRequest* request) const override; 38 bool ShouldServiceRequest(const GURL& url,
39 void WillServiceRequest(const net::URLRequest* request, 39 content::ResourceContext* resource_context,
40 std::string* path) const override; 40 int render_process_id) const override;
41 std::string GetContentSecurityPolicyStyleSrc() const override; 41 std::string GetContentSecurityPolicyStyleSrc() const override;
42 std::string GetContentSecurityPolicyChildSrc() const override; 42 std::string GetContentSecurityPolicyChildSrc() const override;
43 43
44 private: 44 private:
45 friend class DomDistillerViewerSourceTest; 45 friend class DomDistillerViewerSourceTest;
46 46
47 // The scheme this URLDataSource is hosted under. 47 // The scheme this URLDataSource is hosted under.
48 std::string scheme_; 48 std::string scheme_;
49 49
50 // The service which contains all the functionality needed to interact with 50 // The service which contains all the functionality needed to interact with
51 // the list of articles. 51 // the list of articles.
52 DomDistillerServiceInterface* dom_distiller_service_; 52 DomDistillerServiceInterface* dom_distiller_service_;
53 53
54 // An object for accessing chrome-specific UI controls including external 54 // An object for accessing chrome-specific UI controls including external
55 // feedback and opening the distiller settings. 55 // feedback and opening the distiller settings.
56 std::unique_ptr<DistillerUIHandle> distiller_ui_handle_; 56 std::unique_ptr<DistillerUIHandle> distiller_ui_handle_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); 58 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource);
59 }; 59 };
60 60
61 } // namespace dom_distiller 61 } // namespace dom_distiller
62 62
63 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_ H_ 63 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698