| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 native_javascript_handle_->AddJavaScriptObjectToFrame(context); | 53 native_javascript_handle_->AddJavaScriptObjectToFrame(context); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void DistillerJsRenderFrameObserver::RegisterMojoInterface() { | 56 void DistillerJsRenderFrameObserver::RegisterMojoInterface() { |
| 57 render_frame()->GetInterfaceRegistry()->AddInterface(base::Bind( | 57 render_frame()->GetInterfaceRegistry()->AddInterface(base::Bind( |
| 58 &DistillerJsRenderFrameObserver::CreateDistillerPageNotifierService, | 58 &DistillerJsRenderFrameObserver::CreateDistillerPageNotifierService, |
| 59 weak_factory_.GetWeakPtr())); | 59 weak_factory_.GetWeakPtr())); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void DistillerJsRenderFrameObserver::CreateDistillerPageNotifierService( | 62 void DistillerJsRenderFrameObserver::CreateDistillerPageNotifierService( |
| 63 mojo::InterfaceRequest<mojom::DistillerPageNotifierService> request) { | 63 const service_manager::BindSourceInfo& source_info, |
| 64 mojom::DistillerPageNotifierServiceRequest request) { |
| 64 mojo::MakeStrongBinding( | 65 mojo::MakeStrongBinding( |
| 65 base::MakeUnique<DistillerPageNotifierServiceImpl>(this), | 66 base::MakeUnique<DistillerPageNotifierServiceImpl>(this), |
| 66 std::move(request)); | 67 std::move(request)); |
| 67 } | 68 } |
| 68 | 69 |
| 69 void DistillerJsRenderFrameObserver::SetIsDistillerPage() { | 70 void DistillerJsRenderFrameObserver::SetIsDistillerPage() { |
| 70 is_distiller_page_ = true; | 71 is_distiller_page_ = true; |
| 71 } | 72 } |
| 72 | 73 |
| 73 void DistillerJsRenderFrameObserver::OnDestruct() { | 74 void DistillerJsRenderFrameObserver::OnDestruct() { |
| 74 delete this; | 75 delete this; |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace dom_distiller | 78 } // namespace dom_distiller |
| OLD | NEW |