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

Unified Diff: components/dom_distiller/content/browser/distillable_page_utils.cc

Issue 1414283006: Hook up new distillability signal to DistillablePageUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@agent
Patch Set: merge depend Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698