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_RENDERER_DISTILLER_NATIVE_JAVASCRIPT_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_NATIVE_JAVASCRIPT_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_NATIVE_JAVASCRIPT_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_NATIVE_JAVASCRIPT_H_ |
7 | 7 |
8 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" | 8 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" |
9 #include "content/public/renderer/render_frame.h" | 9 #include "content/public/renderer/render_frame.h" |
10 #include "content/public/renderer/render_frame_observer.h" | 10 #include "content/public/renderer/render_frame_observer.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 void BindFunctionToObject(v8::Local<v8::Object> javascript_object, | 30 void BindFunctionToObject(v8::Local<v8::Object> javascript_object, |
31 const std::string& name, | 31 const std::string& name, |
32 const base::Callback<Sig> callback); | 32 const base::Callback<Sig> callback); |
33 // Make sure the mojo service is connected. | 33 // Make sure the mojo service is connected. |
34 void EnsureServiceConnected(); | 34 void EnsureServiceConnected(); |
35 | 35 |
36 // Native code for "distiller.echo" in JavaScript. This simply returns the | 36 // Native code for "distiller.echo" in JavaScript. This simply returns the |
37 // provided string. | 37 // provided string. |
38 std::string DistillerEcho(const std::string& message); | 38 std::string DistillerEcho(const std::string& message); |
39 | 39 |
40 // Send feedback about distillation quality. | |
41 void DistillerSendFeedback(bool good); | |
42 | |
43 // Close the UI panel and record the action. | |
44 void DistillerClosePanel(); | |
45 | |
46 content::RenderFrame* render_frame_; | 40 content::RenderFrame* render_frame_; |
47 DistillerJavaScriptServicePtr distiller_js_service_; | 41 DistillerJavaScriptServicePtr distiller_js_service_; |
48 }; | 42 }; |
49 | 43 |
50 // static | 44 // static |
51 v8::Local<v8::Object> GetOrCreateDistillerObject(v8::Isolate* isolate, | 45 v8::Local<v8::Object> GetOrCreateDistillerObject(v8::Isolate* isolate, |
52 v8::Local<v8::Object> global); | 46 v8::Local<v8::Object> global); |
53 | 47 |
54 } // namespace dom_distiller | 48 } // namespace dom_distiller |
55 | 49 |
56 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_NATIVE_JAVASCRIPT
_H_ | 50 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_NATIVE_JAVASCRIPT
_H_ |
OLD | NEW |