| Index: components/dom_distiller/content/renderer/distiller_native_javascript.cc
|
| diff --git a/components/dom_distiller/content/renderer/distiller_native_javascript.cc b/components/dom_distiller/content/renderer/distiller_native_javascript.cc
|
| index 767dac67ef3d11ccc1a3803702463641308bd8b4..721bfddb59b061f9b85123711ea7ffa0085cff21 100644
|
| --- a/components/dom_distiller/content/renderer/distiller_native_javascript.cc
|
| +++ b/components/dom_distiller/content/renderer/distiller_native_javascript.cc
|
| @@ -45,14 +45,30 @@ void DistillerNativeJavaScript::AddJavaScriptObjectToFrame(
|
| isolate, base::Bind(&DistillerNativeJavaScript::DistillerEcho,
|
| base::Unretained(this)))
|
| ->GetFunction());
|
| +
|
| + distiller_obj->Set(
|
| + gin::StringToSymbol(isolate, "sendFeedback"),
|
| + gin::CreateFunctionTemplate(
|
| + isolate, base::Bind(&DistillerNativeJavaScript::DistillerSendFeedback,
|
| + base::Unretained(this)))
|
| + ->GetFunction());
|
| }
|
|
|
| -std::string DistillerNativeJavaScript::DistillerEcho(
|
| - const std::string& message) {
|
| +void DistillerNativeJavaScript::ensureServiceConnected() {
|
| if (!distiller_js_service_) {
|
| render_frame_->GetServiceRegistry()->ConnectToRemoteService(
|
| mojo::GetProxy(&distiller_js_service_));
|
| }
|
| +}
|
| +
|
| +void DistillerNativeJavaScript::DistillerSendFeedback(bool good) {
|
| + ensureServiceConnected();
|
| + distiller_js_service_->HandleDistillerFeedbackCall(good);
|
| +}
|
| +
|
| +std::string DistillerNativeJavaScript::DistillerEcho(
|
| + const std::string& message) {
|
| + ensureServiceConnected();
|
| // TODO(mdjones): It is possible and beneficial to have information
|
| // returned from the browser process with these calls. The problem
|
| // is waiting blocks this process.
|
|
|