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

Side by Side Diff: components/dom_distiller/content/browser/distillability_driver.h

Issue 2060423003: Watch for RenderFrameHost switch in distillability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add VisibleForTesting to ChromeActivity Created 4 years, 5 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
OLDNEW
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 13 matching lines...) Expand all
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,
33 bool is_iframe_srcdoc) override; 33 bool is_iframe_srcdoc) override;
34 void RenderFrameHostChanged(
35 content::RenderFrameHost* old_host,
36 content::RenderFrameHost* new_host) override;
34 37
35 private: 38 private:
36 explicit DistillabilityDriver(content::WebContents* web_contents); 39 explicit DistillabilityDriver(content::WebContents* web_contents);
37 friend class content::WebContentsUserData<DistillabilityDriver>; 40 friend class content::WebContentsUserData<DistillabilityDriver>;
38 friend class DistillabilityServiceImpl; 41 friend class DistillabilityServiceImpl;
39 42
40 void SetupMojoService(); 43 void SetupMojoService(content::RenderFrameHost* frame_host);
41 void OnDistillability(bool distillable, bool is_last); 44 void OnDistillability(bool distillable, bool is_last);
42 45
43 base::Callback<void(bool, bool)> m_delegate_; 46 base::Callback<void(bool, bool)> m_delegate_;
44 47
45 base::WeakPtrFactory<DistillabilityDriver> weak_factory_; 48 base::WeakPtrFactory<DistillabilityDriver> weak_factory_;
46 49
47 DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver); 50 DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver);
48 }; 51 };
49 52
50 } // namespace dom_distiller 53 } // namespace dom_distiller
51 54
52 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ 55 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698