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 /** | |
8 * Static public methods for WebContents. | |
9 */ | |
10 public class WebContentsStatics { | |
11 /** | |
12 * @return The WebContens associated witht the RenderFrameHost. This can be null. | |
13 */ | |
14 public static WebContents fromRenderFrameHost(RenderFrameHost rfh) { | |
boliu
2017/03/10 19:02:10
this class is free to import non-public content cl
rwlbuis
2017/03/10 21:40:42
Ah, I did not realize that was okay :) Fixed.
| |
15 RenderFrameHostDelegate delegate = rfh.getRenderFrameHostDelegate(); | |
16 if (delegate == null || !(delegate instanceof WebContents)) { | |
17 return null; | |
18 } | |
19 return (WebContents) delegate; | |
20 } | |
21 } | |
OLD | NEW |