| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // If no message about the distilled page was received at this point, there | 35 // If no message about the distilled page was received at this point, there |
| 36 // will not be one; remove the mojom::DistillerPageNotifierService from the | 36 // will not be one; remove the mojom::DistillerPageNotifierService from the |
| 37 // registry. | 37 // registry. |
| 38 render_frame() | 38 render_frame() |
| 39 ->GetInterfaceRegistry() | 39 ->GetInterfaceRegistry() |
| 40 ->RemoveInterface<mojom::DistillerPageNotifierService>(); | 40 ->RemoveInterface<mojom::DistillerPageNotifierService>(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void DistillerJsRenderFrameObserver::DidCreateScriptContext( | 43 void DistillerJsRenderFrameObserver::DidCreateScriptContext( |
| 44 v8::Local<v8::Context> context, | 44 v8::Local<v8::Context> context, |
| 45 int extension_group, | |
| 46 int world_id) { | 45 int world_id) { |
| 47 if (world_id != distiller_isolated_world_id_ || !is_distiller_page_) { | 46 if (world_id != distiller_isolated_world_id_ || !is_distiller_page_) { |
| 48 return; | 47 return; |
| 49 } | 48 } |
| 50 | 49 |
| 51 native_javascript_handle_.reset( | 50 native_javascript_handle_.reset( |
| 52 new DistillerNativeJavaScript(render_frame())); | 51 new DistillerNativeJavaScript(render_frame())); |
| 53 native_javascript_handle_->AddJavaScriptObjectToFrame(context); | 52 native_javascript_handle_->AddJavaScriptObjectToFrame(context); |
| 54 } | 53 } |
| 55 | 54 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 68 | 67 |
| 69 void DistillerJsRenderFrameObserver::SetIsDistillerPage() { | 68 void DistillerJsRenderFrameObserver::SetIsDistillerPage() { |
| 70 is_distiller_page_ = true; | 69 is_distiller_page_ = true; |
| 71 } | 70 } |
| 72 | 71 |
| 73 void DistillerJsRenderFrameObserver::OnDestruct() { | 72 void DistillerJsRenderFrameObserver::OnDestruct() { |
| 74 delete this; | 73 delete this; |
| 75 } | 74 } |
| 76 | 75 |
| 77 } // namespace dom_distiller | 76 } // namespace dom_distiller |
| OLD | NEW |