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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_manager.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/webapps/add_to_homescreen_manager.h
diff --git a/chrome/browser/android/webapps/add_to_homescreen_manager.h b/chrome/browser/android/webapps/add_to_homescreen_manager.h
index 1db089bab6780351e7a626add277ea21c667b5b4..0b039727170011b22f84b11d75015e2dda60440a 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_manager.h
+++ b/chrome/browser/android/webapps/add_to_homescreen_manager.h
@@ -8,6 +8,8 @@
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/android/webapk/chrome_webapk_host.h"
#include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h"
namespace content {
@@ -43,6 +45,23 @@ class AddToHomescreenManager : public AddToHomescreenDataFetcher::Observer {
private:
~AddToHomescreenManager() override;
+ // Called by |Start()| which may check whether the WebAPK Install API is
+ // availabel asynchrously.
+ void StartImpl(content::WebContents* web_contents,
+ bool check_webapk_compatible,
+ bool can_use_webapk_install_flow);
+
+ // Checks whether the Google Play Install API is available when the Google
+ // Play install is allowed.
+ void CanUseGooglePlayInstallApi(
+ const ChromeWebApkHost::CanUseGooglePlayInstallApiCallback& callback);
+
+ // Called when the check of whether the Google Play Install API is available
+ // is done.
+ void OnCanUseGooglePlayInstallApi(content::WebContents* web_contents,
+ bool check_webapk_compatible,
+ bool isAvailable);
+
// Shows alert to prompt user for name of home screen shortcut.
void ShowDialog();
@@ -79,6 +98,8 @@ class AddToHomescreenManager : public AddToHomescreenDataFetcher::Observer {
// Fetches data required to add a shortcut.
scoped_refptr<AddToHomescreenDataFetcher> data_fetcher_;
+ base::WeakPtrFactory<AddToHomescreenManager> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AddToHomescreenManager);
};

Powered by Google App Engine
This is Rietveld 408576698