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

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

Issue 2195123002: Only setup distillability mojo if needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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/browser/distillability_driver.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 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 25 matching lines...) Expand all
36 content::RenderFrameHost* new_host) override; 36 content::RenderFrameHost* new_host) override;
37 37
38 private: 38 private:
39 explicit DistillabilityDriver(content::WebContents* web_contents); 39 explicit DistillabilityDriver(content::WebContents* web_contents);
40 friend class content::WebContentsUserData<DistillabilityDriver>; 40 friend class content::WebContentsUserData<DistillabilityDriver>;
41 friend class DistillabilityServiceImpl; 41 friend class DistillabilityServiceImpl;
42 42
43 void SetupMojoService(content::RenderFrameHost* frame_host); 43 void SetupMojoService(content::RenderFrameHost* frame_host);
44 void OnDistillability(bool distillable, bool is_last); 44 void OnDistillability(bool distillable, bool is_last);
45 45
46 void SetNeedsMojoSetup();
47
46 base::Callback<void(bool, bool)> m_delegate_; 48 base::Callback<void(bool, bool)> m_delegate_;
47 49
50 bool mojo_needs_setup_;
51
48 base::WeakPtrFactory<DistillabilityDriver> weak_factory_; 52 base::WeakPtrFactory<DistillabilityDriver> weak_factory_;
49 53
50 DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver); 54 DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver);
51 }; 55 };
52 56
53 } // namespace dom_distiller 57 } // namespace dom_distiller
54 58
55 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_ 59 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
OLDNEW
« no previous file with comments | « no previous file | components/dom_distiller/content/browser/distillability_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698