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_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "components/dom_distiller/content/common/distillability_service.mojom.h
" | 10 #include "components/dom_distiller/content/common/distillability_service.mojom.h
" |
(...skipping 11 matching lines...) Expand all Loading... |
22 ~DistillabilityDriver() override; | 22 ~DistillabilityDriver() override; |
23 void CreateDistillabilityService( | 23 void CreateDistillabilityService( |
24 mojo::InterfaceRequest<mojom::DistillabilityService> request); | 24 mojo::InterfaceRequest<mojom::DistillabilityService> request); |
25 | 25 |
26 void SetDelegate(const base::Callback<void(bool, bool)>& delegate); | 26 void SetDelegate(const base::Callback<void(bool, bool)>& delegate); |
27 | 27 |
28 // content::WebContentsObserver implementation. | 28 // content::WebContentsObserver implementation. |
29 void DidStartProvisionalLoadForFrame( | 29 void DidStartProvisionalLoadForFrame( |
30 content::RenderFrameHost* render_frame_host, | 30 content::RenderFrameHost* render_frame_host, |
31 const GURL& validated_url, | 31 const GURL& validated_url, |
32 bool is_error_page, | 32 bool is_error_page) override; |
33 bool is_iframe_srcdoc) override; | |
34 void RenderFrameHostChanged( | 33 void RenderFrameHostChanged( |
35 content::RenderFrameHost* old_host, | 34 content::RenderFrameHost* old_host, |
36 content::RenderFrameHost* new_host) override; | 35 content::RenderFrameHost* new_host) override; |
37 | 36 |
38 private: | 37 private: |
39 explicit DistillabilityDriver(content::WebContents* web_contents); | 38 explicit DistillabilityDriver(content::WebContents* web_contents); |
40 friend class content::WebContentsUserData<DistillabilityDriver>; | 39 friend class content::WebContentsUserData<DistillabilityDriver>; |
41 friend class DistillabilityServiceImpl; | 40 friend class DistillabilityServiceImpl; |
42 | 41 |
43 void SetupMojoService(content::RenderFrameHost* frame_host); | 42 void SetupMojoService(content::RenderFrameHost* frame_host); |
44 void OnDistillability(bool distillable, bool is_last); | 43 void OnDistillability(bool distillable, bool is_last); |
45 | 44 |
46 void SetNeedsMojoSetup(); | 45 void SetNeedsMojoSetup(); |
47 | 46 |
48 base::Callback<void(bool, bool)> m_delegate_; | 47 base::Callback<void(bool, bool)> m_delegate_; |
49 | 48 |
50 bool mojo_needs_setup_; | 49 bool mojo_needs_setup_; |
51 | 50 |
52 base::WeakPtrFactory<DistillabilityDriver> weak_factory_; | 51 base::WeakPtrFactory<DistillabilityDriver> weak_factory_; |
53 | 52 |
54 DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver); | 53 DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver); |
55 }; | 54 }; |
56 | 55 |
57 } // namespace dom_distiller | 56 } // namespace dom_distiller |
58 | 57 |
59 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ | 58 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ |
OLD | NEW |