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

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

Issue 1386043002: Open distiller UI setting through JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment nits Created 5 years, 2 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/distiller_javascript_service_impl.cc
diff --git a/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc b/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
index 3f9a7a6081eb6d3597abc16fc61ff5419f5f3fb1..e60e3e299a4a2e2e708a6a94674739448a05532e 100644
--- a/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
+++ b/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "components/dom_distiller/content/browser/distiller_javascript_service_impl.h"
-#include "components/dom_distiller/content/browser/external_feedback_reporter.h"
+#include "components/dom_distiller/content/browser/distiller_ui_handle.h"
#include "components/dom_distiller/core/feedback_reporter.h"
#include "content/public/browser/user_metrics.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/string.h"
@@ -12,11 +12,11 @@ namespace dom_distiller {
DistillerJavaScriptServiceImpl::DistillerJavaScriptServiceImpl(
content::RenderFrameHost* render_frame_host,
- ExternalFeedbackReporter* external_feedback_reporter,
+ DistillerUIHandle* distiller_ui_handle,
mojo::InterfaceRequest<DistillerJavaScriptService> request)
: binding_(this, request.Pass()),
render_frame_host_(render_frame_host),
- external_feedback_reporter_(external_feedback_reporter) {}
+ distiller_ui_handle_(distiller_ui_handle) {}
DistillerJavaScriptServiceImpl::~DistillerJavaScriptServiceImpl() {}
@@ -31,12 +31,12 @@ void DistillerJavaScriptServiceImpl::HandleDistillerFeedbackCall(
}
// If feedback is bad try to start up external feedback.
- if (!external_feedback_reporter_) {
+ if (!distiller_ui_handle_) {
return;
}
content::WebContents* contents =
content::WebContents::FromRenderFrameHost(render_frame_host_);
- external_feedback_reporter_->ReportExternalFeedback(
+ distiller_ui_handle_->ReportExternalFeedback(
contents, contents->GetURL(), false);
return;
}
@@ -45,12 +45,21 @@ void DistillerJavaScriptServiceImpl::HandleDistillerClosePanelCall() {
content::RecordAction(base::UserMetricsAction("DomDistiller_ViewOriginal"));
}
+void DistillerJavaScriptServiceImpl::HandleDistillerOpenSettingsCall() {
+ if (!distiller_ui_handle_) {
+ return;
+ }
+ content::WebContents* contents =
+ content::WebContents::FromRenderFrameHost(render_frame_host_);
+ distiller_ui_handle_->OpenSettings(contents);
+}
+
void CreateDistillerJavaScriptService(
content::RenderFrameHost* render_frame_host,
- ExternalFeedbackReporter* feedback_reporter,
+ DistillerUIHandle* distiller_ui_handle,
mojo::InterfaceRequest<DistillerJavaScriptService> request) {
// This is strongly bound and owned by the pipe.
- new DistillerJavaScriptServiceImpl(render_frame_host, feedback_reporter,
+ new DistillerJavaScriptServiceImpl(render_frame_host, distiller_ui_handle,
request.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698