| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/dom_distiller/content/browser/distiller_ui_handle.h" | 9 #include "components/dom_distiller/content/browser/distiller_ui_handle.h" |
| 10 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" | 10 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 | 12 |
| 13 namespace dom_distiller { | 13 namespace dom_distiller { |
| 14 | 14 |
| 15 // This is the receiving end of "distiller" JavaScript object calls. | 15 // This is the receiving end of "distiller" JavaScript object calls. |
| 16 class DistillerJavaScriptServiceImpl | 16 class DistillerJavaScriptServiceImpl |
| 17 : public mojom::DistillerJavaScriptService { | 17 : public mojom::DistillerJavaScriptService { |
| 18 public: | 18 public: |
| 19 DistillerJavaScriptServiceImpl(content::RenderFrameHost* render_frame_host, | 19 DistillerJavaScriptServiceImpl(content::RenderFrameHost* render_frame_host, |
| 20 DistillerUIHandle* distiller_ui_handle); | 20 DistillerUIHandle* distiller_ui_handle); |
| 21 ~DistillerJavaScriptServiceImpl() override; | 21 ~DistillerJavaScriptServiceImpl() override; |
| 22 | 22 |
| 23 // Mojo mojom::DistillerJavaScriptService implementation. | 23 // Mojo mojom::DistillerJavaScriptService implementation. |
| 24 | 24 |
| 25 // Send UMA feedback and start the external feedback reporter if one exists. | |
| 26 void HandleDistillerFeedbackCall(bool good) override; | |
| 27 | |
| 28 // Make a call into Android to close the overlay panel containing reader mode. | 25 // Make a call into Android to close the overlay panel containing reader mode. |
| 29 void HandleDistillerClosePanelCall(bool animate) override; | 26 void HandleDistillerClosePanelCall(bool animate) override; |
| 30 | 27 |
| 31 // Show the Android view containing Reader Mode settings. | 28 // Show the Android view containing Reader Mode settings. |
| 32 void HandleDistillerOpenSettingsCall() override; | 29 void HandleDistillerOpenSettingsCall() override; |
| 33 | 30 |
| 34 private: | 31 private: |
| 35 content::RenderFrameHost* render_frame_host_; | 32 content::RenderFrameHost* render_frame_host_; |
| 36 DistillerUIHandle* distiller_ui_handle_; | 33 DistillerUIHandle* distiller_ui_handle_; |
| 37 | 34 |
| 38 DISALLOW_COPY_AND_ASSIGN(DistillerJavaScriptServiceImpl); | 35 DISALLOW_COPY_AND_ASSIGN(DistillerJavaScriptServiceImpl); |
| 39 }; | 36 }; |
| 40 | 37 |
| 41 // static | 38 // static |
| 42 void CreateDistillerJavaScriptService( | 39 void CreateDistillerJavaScriptService( |
| 43 content::RenderFrameHost* render_frame_host, | 40 content::RenderFrameHost* render_frame_host, |
| 44 DistillerUIHandle* distiller_ui_handle, | 41 DistillerUIHandle* distiller_ui_handle, |
| 45 mojo::InterfaceRequest<mojom::DistillerJavaScriptService> request); | 42 mojo::InterfaceRequest<mojom::DistillerJavaScriptService> request); |
| 46 | 43 |
| 47 } // namespace dom_distiller | 44 } // namespace dom_distiller |
| 48 | 45 |
| 49 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE
_IMPL_H_ | 46 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE
_IMPL_H_ |
| OLD | NEW |