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

Unified Diff: chrome/browser/android/webapk/chrome_webapk_host.h

Issue 2675803004: Fall back to shortcut A2HS when Phonesky is out of date or unavailable. (Closed)
Patch Set: Update add_to_homescreen_data_fetcher_unittest.cc. Created 3 years, 10 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/browser/android/webapk/chrome_webapk_host.h
diff --git a/chrome/browser/android/webapk/chrome_webapk_host.h b/chrome/browser/android/webapk/chrome_webapk_host.h
index dc84ea17f89f5962f4a7660446398e731274a249..65b77a43554e948925cbec884671eb059b5d9b02 100644
--- a/chrome/browser/android/webapk/chrome_webapk_host.h
+++ b/chrome/browser/android/webapk/chrome_webapk_host.h
@@ -7,20 +7,51 @@
#include <jni.h>
+#include "base/android/scoped_java_ref.h"
+#include "base/callback.h"
#include "base/macros.h"
+
// ChromeWebApkHost is the C++ counterpart of org.chromium.chrome.browser's
// ChromeWebApkHost in Java.
class ChromeWebApkHost {
public:
+ using CanUseGooglePlayInstallApiCallback = base::Callback<void(bool)>;
+
+ ChromeWebApkHost();
+
// Registers JNI hooks.
static bool Register(JNIEnv* env);
// Returns whether the "enalbe-webapk" is turned on.
static bool AreWebApkEnabled();
+ // Returns whether the Google Play Install is allowed.
+ static bool CanUseGooglePlayToInstallWebApk();
+
+ // Checks whether Google Play Install API is available.
pkotwicz 2017/02/03 18:56:32 Nit: Document that the callback can be called sync
Xi Han 2017/02/03 22:16:21 Done.
+ void CanUseGooglePlayInstallApi(
+ const CanUseGooglePlayInstallApiCallback& Callback);
+
+ // Called when the check of whether the Google Play Install API is available
+ // is done.
+ void OnCanUseGooglePlayInstallApi(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jboolean is_available);
+
private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeWebApkHost);
+ ~ChromeWebApkHost();
+
+ // Create the Java object.
+ void CreateJavaRef();
+
+ // Points to the Java Object.
+ base::android::ScopedJavaGlobalRef<jobject> java_ref_;
+
+ CanUseGooglePlayInstallApiCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeWebApkHost);
};
#endif // CHROME_BROWSER_ANDROID_WEBAPK_CHROME_WEBAPK_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698