| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2621 WebContentsImpl::GetGeolocationServiceContext() { | 2621 WebContentsImpl::GetGeolocationServiceContext() { |
| 2622 return geolocation_service_context_.get(); | 2622 return geolocation_service_context_.get(); |
| 2623 } | 2623 } |
| 2624 | 2624 |
| 2625 device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockServiceContext() { | 2625 device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockServiceContext() { |
| 2626 if (!wake_lock_context_host_) | 2626 if (!wake_lock_context_host_) |
| 2627 wake_lock_context_host_.reset(new WakeLockContextHost(this)); | 2627 wake_lock_context_host_.reset(new WakeLockContextHost(this)); |
| 2628 return wake_lock_context_host_->GetWakeLockContext(); | 2628 return wake_lock_context_host_->GetWakeLockContext(); |
| 2629 } | 2629 } |
| 2630 | 2630 |
| 2631 void WebContentsImpl::GetNFC(device::nfc::mojom::NFCRequest request) { |
| 2632 if (!nfc_host_) |
| 2633 nfc_host_.reset(new NFCHost(this)); |
| 2634 nfc_host_->GetNFC(std::move(request)); |
| 2635 } |
| 2636 |
| 2631 void WebContentsImpl::OnShowValidationMessage( | 2637 void WebContentsImpl::OnShowValidationMessage( |
| 2632 RenderViewHostImpl* source, | 2638 RenderViewHostImpl* source, |
| 2633 const gfx::Rect& anchor_in_root_view, | 2639 const gfx::Rect& anchor_in_root_view, |
| 2634 const base::string16& main_text, | 2640 const base::string16& main_text, |
| 2635 const base::string16& sub_text) { | 2641 const base::string16& sub_text) { |
| 2636 // TODO(nick): Should we consider |source| here or pass it to the delegate? | 2642 // TODO(nick): Should we consider |source| here or pass it to the delegate? |
| 2637 if (delegate_) | 2643 if (delegate_) |
| 2638 delegate_->ShowValidationMessage( | 2644 delegate_->ShowValidationMessage( |
| 2639 this, anchor_in_root_view, main_text, sub_text); | 2645 this, anchor_in_root_view, main_text, sub_text); |
| 2640 } | 2646 } |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 | 4317 |
| 4312 if (!render_frame_host->IsRenderFrameLive() || render_frame_host->GetParent()) | 4318 if (!render_frame_host->IsRenderFrameLive() || render_frame_host->GetParent()) |
| 4313 return; | 4319 return; |
| 4314 | 4320 |
| 4315 NavigationEntry* entry = controller_.GetPendingEntry(); | 4321 NavigationEntry* entry = controller_.GetPendingEntry(); |
| 4316 if (entry && entry->IsViewSourceMode()) { | 4322 if (entry && entry->IsViewSourceMode()) { |
| 4317 // Put the renderer in view source mode. | 4323 // Put the renderer in view source mode. |
| 4318 render_frame_host->Send( | 4324 render_frame_host->Send( |
| 4319 new FrameMsg_EnableViewSourceMode(render_frame_host->GetRoutingID())); | 4325 new FrameMsg_EnableViewSourceMode(render_frame_host->GetRoutingID())); |
| 4320 } | 4326 } |
| 4321 #if defined(OS_ANDROID) | |
| 4322 render_frame_host->GetInterfaceRegistry()->AddInterface( | |
| 4323 GetJavaInterfaces()->CreateInterfaceFactory<device::nfc::mojom::NFC>()); | |
| 4324 #endif | |
| 4325 } | 4327 } |
| 4326 | 4328 |
| 4327 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { | 4329 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { |
| 4328 for (auto& observer : observers_) | 4330 for (auto& observer : observers_) |
| 4329 observer.RenderFrameDeleted(render_frame_host); | 4331 observer.RenderFrameDeleted(render_frame_host); |
| 4330 #if BUILDFLAG(ENABLE_PLUGINS) | 4332 #if BUILDFLAG(ENABLE_PLUGINS) |
| 4331 pepper_playback_observer_->RenderFrameDeleted(render_frame_host); | 4333 pepper_playback_observer_->RenderFrameDeleted(render_frame_host); |
| 4332 #endif | 4334 #endif |
| 4333 } | 4335 } |
| 4334 | 4336 |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5602 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5604 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5603 if (!render_view_host) | 5605 if (!render_view_host) |
| 5604 continue; | 5606 continue; |
| 5605 render_view_host_set.insert(render_view_host); | 5607 render_view_host_set.insert(render_view_host); |
| 5606 } | 5608 } |
| 5607 for (RenderViewHost* render_view_host : render_view_host_set) | 5609 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5608 render_view_host->OnWebkitPreferencesChanged(); | 5610 render_view_host->OnWebkitPreferencesChanged(); |
| 5609 } | 5611 } |
| 5610 | 5612 |
| 5611 } // namespace content | 5613 } // namespace content |
| OLD | NEW |