| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DISTILLER_PAGE_WEB_CONTENTS_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ |
| 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 private: | 27 private: |
| 28 // The WebContents this class owns. | 28 // The WebContents this class owns. |
| 29 scoped_ptr<content::WebContents> web_contents_; | 29 scoped_ptr<content::WebContents> web_contents_; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 class DistillerPageWebContentsFactory : public DistillerPageFactory { | 32 class DistillerPageWebContentsFactory : public DistillerPageFactory { |
| 33 public: | 33 public: |
| 34 explicit DistillerPageWebContentsFactory( | 34 explicit DistillerPageWebContentsFactory( |
| 35 content::BrowserContext* browser_context) | 35 content::BrowserContext* browser_context) |
| 36 : DistillerPageFactory(), browser_context_(browser_context) {} | 36 : DistillerPageFactory(), browser_context_(browser_context) {} |
| 37 DistillerPageWebContentsFactory(content::BrowserContext* browser_context, |
| 38 std::string distiller_js_script); |
| 37 ~DistillerPageWebContentsFactory() override {} | 39 ~DistillerPageWebContentsFactory() override {} |
| 38 | 40 |
| 39 scoped_ptr<DistillerPage> CreateDistillerPage( | 41 scoped_ptr<DistillerPage> CreateDistillerPage( |
| 40 const gfx::Size& render_view_size) const override; | 42 const gfx::Size& render_view_size) const override; |
| 41 scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( | 43 scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( |
| 42 scoped_ptr<SourcePageHandle> handle) const override; | 44 scoped_ptr<SourcePageHandle> handle) const override; |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 content::BrowserContext* browser_context_; | 47 content::BrowserContext* browser_context_; |
| 48 // An optional script for overriding the JS that comes packaged with Chrome. |
| 49 std::string distiller_js_script_; |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 class DistillerPageWebContents : public DistillerPage, | 52 class DistillerPageWebContents : public DistillerPage, |
| 49 public content::WebContentsDelegate, | 53 public content::WebContentsDelegate, |
| 50 public content::WebContentsObserver { | 54 public content::WebContentsObserver { |
| 51 public: | 55 public: |
| 52 DistillerPageWebContents( | 56 DistillerPageWebContents( |
| 53 content::BrowserContext* browser_context, | 57 content::BrowserContext* browser_context, |
| 54 const gfx::Size& render_view_size, | 58 const gfx::Size& render_view_size, |
| 55 scoped_ptr<SourcePageHandleWebContents> optional_web_contents_handle); | 59 scoped_ptr<SourcePageHandleWebContents> optional_web_contents_handle); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 110 |
| 107 scoped_ptr<content::WebContents> web_contents_; | 111 scoped_ptr<content::WebContents> web_contents_; |
| 108 content::BrowserContext* browser_context_; | 112 content::BrowserContext* browser_context_; |
| 109 gfx::Size render_view_size_; | 113 gfx::Size render_view_size_; |
| 110 DISALLOW_COPY_AND_ASSIGN(DistillerPageWebContents); | 114 DISALLOW_COPY_AND_ASSIGN(DistillerPageWebContents); |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace dom_distiller | 117 } // namespace dom_distiller |
| 114 | 118 |
| 115 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ | 119 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ |
| OLD | NEW |