| 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/browser/distillability_driver.h" | 5 #include "components/dom_distiller/content/browser/distillability_driver.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 #include "content/public/browser/web_contents_user_data.h" | 12 #include "content/public/browser/web_contents_user_data.h" |
| 13 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 14 #include "services/service_manager/public/cpp/interface_registry.h" | 14 #include "services/service_manager/public/cpp/binder_registry.h" |
| 15 | 15 |
| 16 DEFINE_WEB_CONTENTS_USER_DATA_KEY( | 16 DEFINE_WEB_CONTENTS_USER_DATA_KEY( |
| 17 dom_distiller::DistillabilityDriver); | 17 dom_distiller::DistillabilityDriver); |
| 18 | 18 |
| 19 namespace dom_distiller { | 19 namespace dom_distiller { |
| 20 | 20 |
| 21 // Implementation of the Mojo DistillabilityService. This is called by the | 21 // Implementation of the Mojo DistillabilityService. This is called by the |
| 22 // renderer to notify the browser that a page is distillable. | 22 // renderer to notify the browser that a page is distillable. |
| 23 class DistillabilityServiceImpl : public mojom::DistillabilityService { | 23 class DistillabilityServiceImpl : public mojom::DistillabilityService { |
| 24 public: | 24 public: |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 return; | 102 return; |
| 103 } | 103 } |
| 104 | 104 |
| 105 frame_host->GetInterfaceRegistry()->AddInterface( | 105 frame_host->GetInterfaceRegistry()->AddInterface( |
| 106 base::Bind(&DistillabilityDriver::CreateDistillabilityService, | 106 base::Bind(&DistillabilityDriver::CreateDistillabilityService, |
| 107 weak_factory_.GetWeakPtr())); | 107 weak_factory_.GetWeakPtr())); |
| 108 mojo_needs_setup_ = false; | 108 mojo_needs_setup_ = false; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace dom_distiller | 111 } // namespace dom_distiller |
| OLD | NEW |