OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.content_public.browser; |
| 6 |
| 7 import org.chromium.content.browser.framehost.RenderFrameHostDelegate; |
| 8 import org.chromium.content.browser.framehost.RenderFrameHostImpl; |
| 9 |
| 10 /** |
| 11 * Static public methods for WebContents. |
| 12 */ |
| 13 public class WebContentsStatics { |
| 14 /** |
| 15 * @return The WebContens associated witht the RenderFrameHost. This can be
null. |
| 16 */ |
| 17 public static WebContents fromRenderFrameHost(RenderFrameHost rfh) { |
| 18 RenderFrameHostDelegate delegate = ((RenderFrameHostImpl) rfh).getRender
FrameHostDelegate(); |
| 19 if (delegate == null || !(delegate instanceof WebContents)) { |
| 20 return null; |
| 21 } |
| 22 return (WebContents) delegate; |
| 23 } |
| 24 } |
OLD | NEW |