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_CORE_DISTILLER_PAGE_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "content/public/browser/web_contents.h" | |
nyquist
2015/05/13 07:56:38
//components/dom_distiller/core can not and should
arjunpatel
2015/05/27 00:16:45
I believe this will be removed after the rebase.
| |
14 #include "third_party/dom_distiller_js/dom_distiller.pb.h" | 15 #include "third_party/dom_distiller_js/dom_distiller.pb.h" |
15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
17 | 18 |
18 namespace dom_distiller { | 19 namespace dom_distiller { |
19 | 20 |
20 class SourcePageHandle { | 21 class SourcePageHandle { |
21 public: | 22 public: |
22 virtual ~SourcePageHandle() {} | 23 virtual ~SourcePageHandle() {} |
24 virtual content::WebContents* GetWebContents() const = 0; | |
nyquist
2015/05/13 07:56:39
This can't be part of the SourcePageHandle. That's
arjunpatel
2015/05/27 00:16:45
Acknowledged.
| |
23 }; | 25 }; |
24 | 26 |
25 // Injects JavaScript into a page, and uses it to extract and return long-form | 27 // Injects JavaScript into a page, and uses it to extract and return long-form |
26 // content. The class can be reused to load and distill multiple pages, | 28 // content. The class can be reused to load and distill multiple pages, |
27 // following the state transitions described along with the class's states. | 29 // following the state transitions described along with the class's states. |
28 // Constructing a DistillerPage should be cheap, as some of the instances can be | 30 // Constructing a DistillerPage should be cheap, as some of the instances can be |
29 // thrown away without ever being used. | 31 // thrown away without ever being used. |
30 class DistillerPage { | 32 class DistillerPage { |
31 public: | 33 public: |
32 typedef base::Callback< | 34 typedef base::Callback< |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // used. | 81 // used. |
80 virtual scoped_ptr<DistillerPage> CreateDistillerPage( | 82 virtual scoped_ptr<DistillerPage> CreateDistillerPage( |
81 const gfx::Size& render_view_size) const = 0; | 83 const gfx::Size& render_view_size) const = 0; |
82 virtual scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( | 84 virtual scoped_ptr<DistillerPage> CreateDistillerPageWithHandle( |
83 scoped_ptr<SourcePageHandle> handle) const = 0; | 85 scoped_ptr<SourcePageHandle> handle) const = 0; |
84 }; | 86 }; |
85 | 87 |
86 } // namespace dom_distiller | 88 } // namespace dom_distiller |
87 | 89 |
88 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ | 90 #endif // COMPONENTS_DOM_DISTILLER_CORE_DISTILLER_PAGE_H_ |
OLD | NEW |