OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_IOS_DISTILLER_PAGE_FACTORY_IOS_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_FACTORY_IOS_H_ |
6 #define COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_FACTORY_IOS_H_ | 6 #define COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_FACTORY_IOS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "components/dom_distiller/core/distiller_page.h" | 9 #include "components/dom_distiller/core/distiller_page.h" |
10 | 10 |
11 namespace web { | 11 namespace web { |
12 class BrowserState; | 12 class BrowserState; |
13 } | 13 } |
14 | 14 |
15 namespace dom_distiller { | 15 namespace dom_distiller { |
16 | 16 |
17 class DistillerPageIOS; | 17 class DistillerPageIOS; |
18 | 18 |
19 // DistillerPageFactoryIOS is an iOS-specific implementation of the | 19 // DistillerPageFactoryIOS is an iOS-specific implementation of the |
20 // DistillerPageFactory interface allowing the creation of DistillerPage | 20 // DistillerPageFactory interface allowing the creation of DistillerPage |
21 // instances. | 21 // instances. |
22 class DistillerPageFactoryIOS : public DistillerPageFactory { | 22 class DistillerPageFactoryIOS : public DistillerPageFactory { |
23 public: | 23 public: |
24 DistillerPageFactoryIOS(web::BrowserState* browser_state); | 24 DistillerPageFactoryIOS(web::BrowserState* browser_state, |
| 25 const std::string& distiller_js_script); |
25 | 26 |
26 // Implementation of DistillerPageFactory: | 27 // Implementation of DistillerPageFactory: |
27 scoped_ptr<DistillerPage> CreateDistillerPage( | 28 scoped_ptr<DistillerPage> CreateDistillerPage( |
28 const gfx::Size& view_size) const override; | 29 const gfx::Size& view_size) const override; |
29 scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( | 30 scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( |
30 scoped_ptr<SourcePageHandle> handle) const override; | 31 scoped_ptr<SourcePageHandle> handle) const override; |
31 | 32 |
32 private: | 33 private: |
33 web::BrowserState* browser_state_; | 34 web::BrowserState* browser_state_; |
| 35 |
| 36 // Contains the script which will be passed on when constructing the |
| 37 // DistillerPageIOS. It should contain the string $$OPTIONS, which |
| 38 // will be replaced with options passed in as proto::DomDistillerOptions |
| 39 // before it is executed in the page context. |
| 40 std::string distiller_js_script_; |
34 }; | 41 }; |
35 | 42 |
36 } // namespace dom_distiller | 43 } // namespace dom_distiller |
37 | 44 |
38 #endif // COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_FACTORY_IOS_H_ | 45 #endif // COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_FACTORY_IOS_H_ |
OLD | NEW |