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 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob
server.h" | 5 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob
server.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "components/dom_distiller/content/common/distiller_page_notifier_servic
e.mojom.h" | 11 #include "components/dom_distiller/content/common/distiller_page_notifier_servic
e.mojom.h" |
12 #include "components/dom_distiller/content/renderer/distiller_page_notifier_serv
ice_impl.h" | 12 #include "components/dom_distiller/content/renderer/distiller_page_notifier_serv
ice_impl.h" |
13 #include "content/public/renderer/render_frame.h" | 13 #include "content/public/renderer/render_frame.h" |
14 #include "mojo/public/cpp/bindings/strong_binding.h" | 14 #include "mojo/public/cpp/bindings/strong_binding.h" |
15 #include "services/service_manager/public/cpp/interface_registry.h" | 15 #include "services/service_manager/public/cpp/interface_registry.h" |
16 #include "v8/include/v8.h" | 16 #include "v8/include/v8.h" |
17 | 17 |
18 namespace dom_distiller { | 18 namespace dom_distiller { |
19 | 19 |
20 DistillerJsRenderFrameObserver::DistillerJsRenderFrameObserver( | 20 DistillerJsRenderFrameObserver::DistillerJsRenderFrameObserver( |
21 content::RenderFrame* render_frame, | 21 content::RenderFrame* render_frame, |
22 const int distiller_isolated_world_id) | 22 const int distiller_isolated_world_id) |
23 : RenderFrameObserver(render_frame), | 23 : RenderFrameObserver(render_frame), |
24 distiller_isolated_world_id_(distiller_isolated_world_id), | 24 distiller_isolated_world_id_(distiller_isolated_world_id), |
25 is_distiller_page_(false), | 25 is_distiller_page_(false), |
26 weak_factory_(this) {} | 26 weak_factory_(this) {} |
27 | 27 |
28 DistillerJsRenderFrameObserver::~DistillerJsRenderFrameObserver() {} | 28 DistillerJsRenderFrameObserver::~DistillerJsRenderFrameObserver() {} |
29 | 29 |
30 void DistillerJsRenderFrameObserver::DidStartProvisionalLoad() { | 30 void DistillerJsRenderFrameObserver::DidStartProvisionalLoad( |
| 31 blink::WebDataSource* data_source) { |
31 RegisterMojoInterface(); | 32 RegisterMojoInterface(); |
32 } | 33 } |
33 | 34 |
34 void DistillerJsRenderFrameObserver::DidFinishLoad() { | 35 void DistillerJsRenderFrameObserver::DidFinishLoad() { |
35 // If no message about the distilled page was received at this point, there | 36 // If no message about the distilled page was received at this point, there |
36 // will not be one; remove the mojom::DistillerPageNotifierService from the | 37 // will not be one; remove the mojom::DistillerPageNotifierService from the |
37 // registry. | 38 // registry. |
38 render_frame() | 39 render_frame() |
39 ->GetInterfaceRegistry() | 40 ->GetInterfaceRegistry() |
40 ->RemoveInterface<mojom::DistillerPageNotifierService>(); | 41 ->RemoveInterface<mojom::DistillerPageNotifierService>(); |
(...skipping 26 matching lines...) Expand all Loading... |
67 | 68 |
68 void DistillerJsRenderFrameObserver::SetIsDistillerPage() { | 69 void DistillerJsRenderFrameObserver::SetIsDistillerPage() { |
69 is_distiller_page_ = true; | 70 is_distiller_page_ = true; |
70 } | 71 } |
71 | 72 |
72 void DistillerJsRenderFrameObserver::OnDestruct() { | 73 void DistillerJsRenderFrameObserver::OnDestruct() { |
73 delete this; | 74 delete this; |
74 } | 75 } |
75 | 76 |
76 } // namespace dom_distiller | 77 } // namespace dom_distiller |
OLD | NEW |