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/contextual_search/renderer/overlay_js_render_frame_observer
.h" | 5 #include "components/contextual_search/renderer/overlay_js_render_frame_observer
.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 19 matching lines...) Expand all Loading... |
30 RegisterMojoInterface(); | 30 RegisterMojoInterface(); |
31 } | 31 } |
32 | 32 |
33 void OverlayJsRenderFrameObserver::RegisterMojoInterface() { | 33 void OverlayJsRenderFrameObserver::RegisterMojoInterface() { |
34 render_frame()->GetInterfaceRegistry()->AddInterface(base::Bind( | 34 render_frame()->GetInterfaceRegistry()->AddInterface(base::Bind( |
35 &OverlayJsRenderFrameObserver::CreateOverlayPageNotifierService, | 35 &OverlayJsRenderFrameObserver::CreateOverlayPageNotifierService, |
36 weak_factory_.GetWeakPtr())); | 36 weak_factory_.GetWeakPtr())); |
37 } | 37 } |
38 | 38 |
39 void OverlayJsRenderFrameObserver::CreateOverlayPageNotifierService( | 39 void OverlayJsRenderFrameObserver::CreateOverlayPageNotifierService( |
40 mojo::InterfaceRequest<mojom::OverlayPageNotifierService> request) { | 40 const service_manager::BindSourceInfo& source_info, |
| 41 mojom::OverlayPageNotifierServiceRequest request) { |
41 mojo::MakeStrongBinding( | 42 mojo::MakeStrongBinding( |
42 base::MakeUnique<OverlayPageNotifierServiceImpl>( | 43 base::MakeUnique<OverlayPageNotifierServiceImpl>( |
43 weak_factory_.GetWeakPtr()), | 44 weak_factory_.GetWeakPtr()), |
44 std::move(request)); | 45 std::move(request)); |
45 } | 46 } |
46 | 47 |
47 void OverlayJsRenderFrameObserver::SetIsContextualSearchOverlay() { | 48 void OverlayJsRenderFrameObserver::SetIsContextualSearchOverlay() { |
48 is_contextual_search_overlay_ = true; | 49 is_contextual_search_overlay_ = true; |
49 } | 50 } |
50 | 51 |
(...skipping 17 matching lines...) Expand all Loading... |
68 ->RemoveInterface<mojom::OverlayPageNotifierService>(); | 69 ->RemoveInterface<mojom::OverlayPageNotifierService>(); |
69 } | 70 } |
70 } | 71 } |
71 | 72 |
72 void OverlayJsRenderFrameObserver::OnDestruct() { | 73 void OverlayJsRenderFrameObserver::OnDestruct() { |
73 DestroyOverlayPageNotifierService(); | 74 DestroyOverlayPageNotifierService(); |
74 delete this; | 75 delete this; |
75 } | 76 } |
76 | 77 |
77 } // namespace contextual_search | 78 } // namespace contextual_search |
OLD | NEW |