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

Side by Side Diff: components/dom_distiller/content/renderer/distiller_js_render_frame_observer.h

Issue 1231083007: Expose distiller functions to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-content
Patch Set: cl format Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_JS_RENDER_FRAME_OBSE RVER_H_
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_JS_RENDER_FRAME_OBSE RVER_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "components/dom_distiller/content/common/distiller_javascript_service.m ojom.h"
10 #include "components/dom_distiller/content/renderer/distiller_native_javascript. h"
11 #include "components/dom_distiller/content/renderer/distiller_page_notifier_serv ice_impl.h"
12 #include "content/public/renderer/render_frame.h"
13 #include "content/public/renderer/render_frame_observer.h"
14 #include "third_party/WebKit/public/web/WebLocalFrame.h"
15 #include "v8/include/v8.h"
16
17 namespace dom_distiller {
18
19 class DistillerJsRenderFrameObserver : public content::RenderFrameObserver {
20 public:
21 DistillerJsRenderFrameObserver(content::RenderFrame* render_frame);
22 // RenderFrameObserver implementation.
23 void DidStartProvisionalLoad() override;
24 void DidClearWindowObject() override;
25 ~DistillerJsRenderFrameObserver() override;
26
27 void RegisterMojoService();
nyquist 2015/07/27 21:44:33 How do these two methods below differ? Could you a
mdjones 2015/07/28 20:53:41 One of the function names needed to be updated. Do
28 void SetupMojoForJavaScript();
nyquist 2015/07/27 21:44:33 Why is this method public? Isn't it only called fr
mdjones 2015/07/28 20:53:42 No, it is called by the DistillerPageNotifierImpl.
29
30 private:
31 void createDistillerPageNotifierService(
nyquist 2015/07/27 21:44:33 createDistillerPageNotifierService
mdjones 2015/07/28 20:53:42 That is what it currently is.
32 mojo::InterfaceRequest<DistillerPageNotifierService> request);
33
34 // Track if the current page is distilled. This is needed for testing.
35 bool is_distiller_page_;
36
37 // Handle to "distiller" JavaScript object functionality.
38 scoped_ptr<DistillerNativeJavaScript> native_javascript_handle_;
39 base::WeakPtrFactory<DistillerJsRenderFrameObserver> weak_factory_;
40 };
41
42 } // namespace dom_distiller
43
44 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_RENDERER_DISTILLER_JS_RENDER_FRAME_O BSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698