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

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

Issue 1043263004: Basic hookup for distiller feedback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rebase-html-feedback
Patch Set: rebase Created 5 years, 9 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
« no previous file with comments | « no previous file | components/dom_distiller/core/javascript/dom_distiller_viewer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/content/dom_distiller_viewer_source.cc
diff --git a/components/dom_distiller/content/dom_distiller_viewer_source.cc b/components/dom_distiller/content/dom_distiller_viewer_source.cc
index 4b4a7ce4b18c8dca384a81bc54c3b45a983a7824..b478ce2212d63c471d24d39a2f507301abbcb8ce 100644
--- a/components/dom_distiller/content/dom_distiller_viewer_source.cc
+++ b/components/dom_distiller/content/dom_distiller_viewer_source.cc
@@ -8,7 +8,6 @@
#include <string>
#include <vector>
-#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -16,6 +15,7 @@
#include "base/strings/utf_string_conversions.h"
#include "components/dom_distiller/core/distilled_page_prefs.h"
#include "components/dom_distiller/core/dom_distiller_service.h"
+#include "components/dom_distiller/core/feedback_reporter.h"
#include "components/dom_distiller/core/task_tracker.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/dom_distiller/core/viewer.h"
@@ -308,16 +308,20 @@ void DomDistillerViewerSource::StartDataRequest(
std::string css = viewer::GetCss();
callback.Run(base::RefCountedString::TakeString(&css));
return;
- }
- if (kViewerJsPath == path) {
+ } else if (kViewerJsPath == path) {
std::string js = viewer::GetJavaScript();
callback.Run(base::RefCountedString::TakeString(&js));
return;
- }
- if (kViewerViewOriginalPath == path) {
+ } else if (kViewerViewOriginalPath == path) {
content::RecordAction(base::UserMetricsAction("DomDistiller_ViewOriginal"));
callback.Run(NULL);
return;
+ } else if (kFeedbackBad == path) {
+ FeedbackReporter::ReportQuality(false);
wychen 2015/04/27 21:18:49 Do we need "callback.Run(NULL)" like kViewerViewOr
cjhopman 2015/04/27 21:22:57 Yeah, probably. Otherwise these gets will just be
mdjones 2015/04/27 22:09:02 CL fixing this issue: https://codereview.chromium.
+ return;
+ } else if (kFeedbackGood == path) {
+ FeedbackReporter::ReportQuality(true);
+ return;
}
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
« no previous file with comments | « no previous file | components/dom_distiller/core/javascript/dom_distiller_viewer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698