OLD | NEW |
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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class RequestViewerHandle; | 28 class RequestViewerHandle; |
29 | 29 |
30 // Overridden from content::URLDataSource: | 30 // Overridden from content::URLDataSource: |
31 virtual std::string GetSource() const OVERRIDE; | 31 virtual std::string GetSource() const OVERRIDE; |
32 virtual void StartDataRequest( | 32 virtual void StartDataRequest( |
33 const std::string& path, | 33 const std::string& path, |
34 int render_process_id, | 34 int render_process_id, |
35 int render_frame_id, | 35 int render_frame_id, |
36 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 36 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; |
37 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 37 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
38 virtual bool ShouldServiceRequest(const net::URLRequest* request) const | 38 virtual bool ShouldServiceRequest( |
39 OVERRIDE; | 39 const net::URLRequest* request) const OVERRIDE; |
40 virtual void WillServiceRequest(const net::URLRequest* request, | 40 virtual void WillServiceRequest(const net::URLRequest* request, |
41 std::string* path) const OVERRIDE; | 41 std::string* path) const OVERRIDE; |
42 virtual std::string GetContentSecurityPolicyObjectSrc() const OVERRIDE; | 42 virtual std::string GetContentSecurityPolicyObjectSrc() const OVERRIDE; |
43 | 43 |
44 private: | 44 private: |
45 friend class DomDistillerViewerSourceTest; | 45 friend class DomDistillerViewerSourceTest; |
46 | 46 |
47 // Based on the given path, calls into the DomDistillerServiceInterface for | |
48 // viewing distilled content based on the |path|. | |
49 scoped_ptr<ViewerHandle> CreateViewRequest( | |
50 const std::string& path, | |
51 ViewRequestDelegate* view_request_delegate); | |
52 | |
53 // The scheme this URLDataSource is hosted under. | 47 // The scheme this URLDataSource is hosted under. |
54 std::string scheme_; | 48 std::string scheme_; |
55 | 49 |
56 // The service which contains all the functionality needed to interact with | 50 // The service which contains all the functionality needed to interact with |
57 // the list of articles. | 51 // the list of articles. |
58 DomDistillerServiceInterface* dom_distiller_service_; | 52 DomDistillerServiceInterface* dom_distiller_service_; |
59 | 53 |
60 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); | 54 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); |
61 }; | 55 }; |
62 | 56 |
63 } // namespace dom_distiller | 57 } // namespace dom_distiller |
64 | 58 |
65 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ | 59 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DOM_DISTILLER_VIEWER_SOURCE_H_ |
OLD | NEW |