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

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

Issue 646943005: Make GetSecurityLevel available from the java ToolbarModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved null check Created 6 years, 2 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/Tab.java ('k') | chrome/browser/android/tab_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5655bfca23f2226fd0cdca979f892f20e80083aa..1ff8be9d7571ae6f79ae09078a64c118d71ec538 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;
/**
@@ -26,6 +27,19 @@ public class ToolbarModel {
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);
+ }
+
+ /**
* Initialize the native counterpart of this model.
* @param delegate The delegate that will be used by the model.
*/
@@ -60,6 +74,8 @@ public class ToolbarModel {
return nativeGetCorpusChipText(mNativeToolbarModelAndroid);
}
+ private static native int nativeGetSecurityLevelForWebContents(WebContents webContents);
+
private native long nativeInit(ToolbarModelDelegate delegate);
private native void nativeDestroy(long nativeToolbarModelAndroid);
private native String nativeGetText(long nativeToolbarModelAndroid);
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/Tab.java ('k') | chrome/browser/android/tab_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698