OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IM
PL_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IM
PL_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IM
PL_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IM
PL_H_ |
7 | 7 |
| 8 #include "components/dom_distiller/content/browser/external_feedback_reporter.h" |
8 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" | 9 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" |
9 #include "third_party/mojo/src/mojo/public/cpp/bindings/string.h" | 10 #include "third_party/mojo/src/mojo/public/cpp/bindings/string.h" |
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 11 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
11 | 12 |
12 namespace dom_distiller { | 13 namespace dom_distiller { |
13 | 14 |
14 // This is the receiving end of "distiller" JavaScript object calls. | 15 // This is the receiving end of "distiller" JavaScript object calls. |
15 class DistillerJavaScriptServiceImpl : public DistillerJavaScriptService { | 16 class DistillerJavaScriptServiceImpl : public DistillerJavaScriptService { |
16 public: | 17 public: |
17 DistillerJavaScriptServiceImpl( | 18 DistillerJavaScriptServiceImpl( |
| 19 content::RenderFrameHost* render_frame_host, |
| 20 ExternalFeedbackReporter* external_feedback_reporter, |
18 mojo::InterfaceRequest<DistillerJavaScriptService> request); | 21 mojo::InterfaceRequest<DistillerJavaScriptService> request); |
19 ~DistillerJavaScriptServiceImpl() override; | 22 ~DistillerJavaScriptServiceImpl() override; |
20 | 23 |
21 // Mojo DistillerJavaScriptService implementation. | 24 // Mojo DistillerJavaScriptService implementation. |
| 25 |
| 26 // Echo implementation, this call does not actually return as it would be |
| 27 // blocking. |
22 void HandleDistillerEchoCall(const mojo::String& message) override; | 28 void HandleDistillerEchoCall(const mojo::String& message) override; |
23 | 29 |
| 30 // Send UMA feedback and start the external feedback reporter if one exists. |
| 31 void HandleDistillerFeedbackCall(bool good) override; |
| 32 |
24 private: | 33 private: |
25 mojo::StrongBinding<DistillerJavaScriptService> binding_; | 34 mojo::StrongBinding<DistillerJavaScriptService> binding_; |
| 35 content::RenderFrameHost* render_frame_host_; |
| 36 ExternalFeedbackReporter* external_feedback_reporter_; |
26 }; | 37 }; |
27 | 38 |
28 // static | 39 // static |
29 void CreateDistillerJavaScriptService( | 40 void CreateDistillerJavaScriptService( |
| 41 content::RenderFrameHost* render_frame_host, |
| 42 ExternalFeedbackReporter* feedback_reporter, |
30 mojo::InterfaceRequest<DistillerJavaScriptService> request); | 43 mojo::InterfaceRequest<DistillerJavaScriptService> request); |
31 | 44 |
32 } // namespace dom_distiller | 45 } // namespace dom_distiller |
33 | 46 |
34 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE
_IMPL_H_ | 47 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE
_IMPL_H_ |
OLD | NEW |