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_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 <string> | 9 #include <string> |
9 | 10 |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "components/dom_distiller/content/browser/distiller_ui_handle.h" | 13 #include "components/dom_distiller/content/browser/distiller_ui_handle.h" |
14 #include "content/public/browser/url_data_source.h" | 14 #include "content/public/browser/url_data_source.h" |
15 | 15 |
16 namespace dom_distiller { | 16 namespace dom_distiller { |
17 | 17 |
18 class DomDistillerServiceInterface; | 18 class DomDistillerServiceInterface; |
19 class DomDistillerViewerSourceTest; | 19 class DomDistillerViewerSourceTest; |
20 class ViewerHandle; | 20 class ViewerHandle; |
21 class ViewRequestDelegate; | 21 class ViewRequestDelegate; |
22 | 22 |
23 // Serves HTML and resources for viewing distilled articles. | 23 // Serves HTML and resources for viewing distilled articles. |
24 class DomDistillerViewerSource : public content::URLDataSource { | 24 class DomDistillerViewerSource : public content::URLDataSource { |
25 public: | 25 public: |
26 DomDistillerViewerSource( | 26 DomDistillerViewerSource(DomDistillerServiceInterface* dom_distiller_service, |
27 DomDistillerServiceInterface* dom_distiller_service, | 27 const std::string& scheme, |
28 const std::string& scheme, | 28 std::unique_ptr<DistillerUIHandle> ui_handle); |
29 scoped_ptr<DistillerUIHandle> ui_handle); | |
30 ~DomDistillerViewerSource() override; | 29 ~DomDistillerViewerSource() override; |
31 | 30 |
32 class RequestViewerHandle; | 31 class RequestViewerHandle; |
33 | 32 |
34 // Overridden from content::URLDataSource: | 33 // Overridden from content::URLDataSource: |
35 std::string GetSource() const override; | 34 std::string GetSource() const override; |
36 void StartDataRequest( | 35 void StartDataRequest( |
37 const std::string& path, | 36 const std::string& path, |
38 int render_process_id, | 37 int render_process_id, |
39 int render_frame_id, | 38 int render_frame_id, |
(...skipping 10 matching lines...) Expand all Loading... |
50 | 49 |
51 // The scheme this URLDataSource is hosted under. | 50 // The scheme this URLDataSource is hosted under. |
52 std::string scheme_; | 51 std::string scheme_; |
53 | 52 |
54 // The service which contains all the functionality needed to interact with | 53 // The service which contains all the functionality needed to interact with |
55 // the list of articles. | 54 // the list of articles. |
56 DomDistillerServiceInterface* dom_distiller_service_; | 55 DomDistillerServiceInterface* dom_distiller_service_; |
57 | 56 |
58 // An object for accessing chrome-specific UI controls including external | 57 // An object for accessing chrome-specific UI controls including external |
59 // feedback and opening the distiller settings. | 58 // feedback and opening the distiller settings. |
60 scoped_ptr<DistillerUIHandle> distiller_ui_handle_; | 59 std::unique_ptr<DistillerUIHandle> distiller_ui_handle_; |
61 | 60 |
62 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); | 61 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); |
63 }; | 62 }; |
64 | 63 |
65 } // namespace dom_distiller | 64 } // namespace dom_distiller |
66 | 65 |
67 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_
H_ | 66 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DOM_DISTILLER_VIEWER_SOURCE_
H_ |
OLD | NEW |