Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1110)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java

Issue 1138473003: Revert of Move SecurityLevel into a class of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
index 6d1d591b7f82787c3ceafb0bc11b87521ce02d1c..e8aeac595bc32f7e1e7acb3630e180c60a0fe1fe 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarModel.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser.toolbar;
import org.chromium.base.CalledByNative;
+import org.chromium.chrome.browser.ui.toolbar.ToolbarModelSecurityLevel;
import org.chromium.content_public.browser.WebContents;
/**
@@ -24,6 +25,19 @@
}
private long mNativeToolbarModelAndroid;
+
+ /**
+ * Fetch the security level for a given web contents.
+ *
+ * @param webContents The web contents to get the security level for.
+ * @return The ToolbarModelSecurityLevel for the specified web contents.
+ *
+ * @see ToolbarModelSecurityLevel
+ */
+ public static int getSecurityLevelForWebContents(WebContents webContents) {
+ if (webContents == null) return ToolbarModelSecurityLevel.NONE;
+ return nativeGetSecurityLevelForWebContents(webContents);
+ }
/**
* @param webContents The web contents to query for deprecated SHA-1 presence.
@@ -69,6 +83,7 @@
return nativeWouldReplaceURL(mNativeToolbarModelAndroid);
}
+ private static native int nativeGetSecurityLevelForWebContents(WebContents webContents);
private static native boolean nativeIsDeprecatedSHA1Present(WebContents webContents);
private native long nativeInit(ToolbarModelDelegate delegate);

Powered by Google App Engine
This is Rietveld 408576698