OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 package org.chromium.chrome.browser.ssl; | |
6 | |
7 import org.chromium.content_public.browser.WebContents; | |
8 | |
9 /** | |
10 * Provides a way of accessing helpers for page security state. | |
11 */ | |
12 public class SecurityStateModel { | |
13 /** Notify that the security state has changed for a given web contents. | |
Ted C
2015/09/04 00:36:50
I would put this on the following ling to be consi
estark
2015/09/04 16:53:09
Ack, removed this method.
| |
14 * | |
15 * @param webContents The web contents whose security state has changed. | |
16 */ | |
17 public static void securityStateChanged(WebContents webContents) { | |
18 if (webContents == null) return; | |
19 nativeSecurityStateChanged(webContents); | |
20 } | |
21 | |
22 /** | |
23 * Fetch the security level for a given web contents. | |
24 * | |
25 * @param webContents The web contents to get the security level for. | |
26 * @return The ConnectionSecurityLevel for the specified web contents. | |
27 * | |
28 * @see ConnectionSecurityLevel | |
29 */ | |
30 public static int getSecurityLevelForWebContents(WebContents webContents) { | |
31 if (webContents == null) return ConnectionSecurityLevel.NONE; | |
32 return nativeGetSecurityLevelForWebContents(webContents); | |
33 } | |
34 | |
35 /** | |
36 * @param webContents The web contents to query for deprecated SHA-1 presenc e. | |
37 * @return Whether the security level of the page was deprecated due to SHA- 1. | |
38 */ | |
39 public static boolean isDeprecatedSHA1Present(WebContents webContents) { | |
40 if (webContents == null) return false; | |
41 return nativeIsDeprecatedSHA1Present(webContents); | |
42 } | |
43 | |
44 /** | |
45 * @param webContents The web contents to query for passive mixed content pr esence. | |
46 * @return Whether the page contains passive mixed content. | |
47 */ | |
48 public static boolean isPassiveMixedContentPresent(WebContents webContents) { | |
49 if (webContents == null) return false; | |
50 return nativeIsPassiveMixedContentPresent(webContents); | |
51 } | |
52 | |
53 private SecurityStateModel() {} | |
54 | |
55 private static native void nativeSecurityStateChanged(WebContents webContent s); | |
56 private static native int nativeGetSecurityLevelForWebContents(WebContents w ebContents); | |
57 private static native boolean nativeIsDeprecatedSHA1Present(WebContents webC ontents); | |
58 private static native boolean nativeIsPassiveMixedContentPresent(WebContents webContents); | |
59 } | |
OLD | NEW |