Index: components/dom_distiller/content/browser/distillable_page_utils.cc |
diff --git a/components/dom_distiller/content/browser/distillable_page_utils.cc b/components/dom_distiller/content/browser/distillable_page_utils.cc |
index 5487c62e87dc4e0eda1daecad009f9dd20463709..56d606b242ad069bf021e257d614bbee75c85120 100644 |
--- a/components/dom_distiller/content/browser/distillable_page_utils.cc |
+++ b/components/dom_distiller/content/browser/distillable_page_utils.cc |
@@ -10,6 +10,7 @@ |
#include "base/strings/utf_string_conversions.h" |
#include "base/thread_task_runner_handle.h" |
#include "base/values.h" |
+#include "components/dom_distiller/content/browser/distillability_driver.h" |
#include "components/dom_distiller/content/browser/distiller_javascript_utils.h" |
#include "components/dom_distiller/core/distillable_page_detector.h" |
#include "components/dom_distiller/core/experiments.h" |
@@ -98,4 +99,15 @@ void IsDistillablePageForDetector(content::WebContents* web_contents, |
base::Bind(OnExtractFeaturesJsResult, detector, callback)); |
} |
+void setDelegate(content::WebContents* web_contents, |
+ DistillabilityDelegate delegate) { |
+ CHECK(web_contents); |
+ DistillabilityDriver::CreateForWebContents(web_contents); |
+ |
+ DistillabilityDriver *driver = |
+ DistillabilityDriver::FromWebContents(web_contents); |
+ CHECK(driver); |
+ driver->SetDelegate(delegate); |
+} |
+ |
} // namespace dom_distiller |