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

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

Issue 1265843005: Refactor feedback to use native JS object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@js-mojo-combine
Patch Set: impl comments Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
index 03d9b2b00c937e95b8a7426d81eb5056e8e34360..a71fc07eb63be5b48c804fd67b941576bd22d5e4 100644
--- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
+++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
@@ -202,20 +202,6 @@ void DomDistillerViewerSource::StartDataRequest(
content::RecordAction(base::UserMetricsAction("DomDistiller_ViewOriginal"));
callback.Run(NULL);
return;
- } else if (kFeedbackBad == path) {
- FeedbackReporter::ReportQuality(false);
- callback.Run(NULL);
- if (!external_feedback_reporter_)
- return;
- content::WebContents* contents =
- content::WebContents::FromRenderFrameHost(render_frame_host);
- external_feedback_reporter_->ReportExternalFeedback(
- contents, contents->GetURL(), false);
- return;
- } else if (kFeedbackGood == path) {
- FeedbackReporter::ReportQuality(true);
- callback.Run(NULL);
- return;
}
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
@@ -240,7 +226,9 @@ void DomDistillerViewerSource::StartDataRequest(
// Add mojo service for JavaScript functionality. This is the receiving end
// of this particular service.
render_frame_host->GetServiceRegistry()->AddService(
- base::Bind(&CreateDistillerJavaScriptService));
+ base::Bind(&CreateDistillerJavaScriptService,
+ render_frame_host,
+ external_feedback_reporter_.get()));
// Tell the renderer that this is currently a distilled page.
DistillerPageNotifierServicePtr page_notifier_service;

Powered by Google App Engine
This is Rietveld 408576698