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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsSettings.java

Issue 2379783002: Instant App Banner logic. (Closed)
Patch Set: Fixing tests. Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsSettings.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsSettings.java
new file mode 100644
index 0000000000000000000000000000000000000000..dfc82c18dfe43ce67a7aab0bfedc6e0645b4571e
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsSettings.java
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.instantapps;
+
+import org.chromium.content_public.browser.WebContents;
+
+/**
+ * A bridge class for retrieving Instant Apps-related settings.
+ */
+public class InstantAppsSettings {
+
+ /**
+ * Check whether the instant app at the given url should be opened by default.
+ */
+ public static boolean isInstantAppDefault(WebContents webContents, String url) {
+ return nativeGetInstantAppDefault(webContents, url);
+ }
+
+ /**
+ * Remember that the instant app at the given url should be opened by default.
+ */
+ public static void setInstantAppDefault(WebContents webContents, String url) {
+ nativeSetInstantAppDefault(webContents, url);
+ }
+
+ /**
+ * Check whether the banner promoting an instant app should be shown.
+ */
+ public static boolean shouldShowBanner(WebContents webContents, String url) {
+ return nativeShouldShowBanner(webContents, url);
+ }
+
+ private static native boolean nativeGetInstantAppDefault(WebContents webContents, String url);
+ private static native void nativeSetInstantAppDefault(WebContents webContents, String url);
+ private static native boolean nativeShouldShowBanner(WebContents webContents, String url);
+}

Powered by Google App Engine
This is Rietveld 408576698