Chromium Code Reviews| 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_ |