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

Side by Side Diff: components/dom_distiller/content/distiller_page_web_contents.h

Issue 901793002: Add support for providing an external file for extracting content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 10 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
« no previous file with comments | « no previous file | components/dom_distiller/content/distiller_page_web_contents.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
cjhopman 2015/02/07 01:16:48 I'd say make this non-optional and have the caller
nyquist 2015/03/09 20:40:03 Done.
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(
cjhopman 2015/02/07 01:16:48 shouldn't this constructor take the distiller scri
nyquist 2015/03/09 20:40:03 Done.
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);
56 ~DistillerPageWebContents() override; 60 ~DistillerPageWebContents() override;
57 61
58 // content::WebContentsDelegate implementation. 62 // content::WebContentsDelegate implementation.
59 gfx::Size GetSizeForNewRenderView( 63 gfx::Size GetSizeForNewRenderView(
60 content::WebContents* web_contents) const override; 64 content::WebContents* web_contents) const override;
61 65
62 // content::WebContentsObserver implementation. 66 // content::WebContentsObserver implementation.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW
« no previous file with comments | « no previous file | components/dom_distiller/content/distiller_page_web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698