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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_manager.cc

Issue 2363183002: Skip installation process if WebAPK is already installed. (Closed)
Patch Set: Created 4 years, 3 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.cc
diff --git a/chrome/browser/android/webapps/add_to_homescreen_manager.cc b/chrome/browser/android/webapps/add_to_homescreen_manager.cc
index 63972125122204e2be072ac8905c613d708f2a87..44da93fbcc7921086584cec73dd4f392b9d33c4e 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_manager.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_manager.cc
@@ -69,10 +69,11 @@ void AddToHomescreenManager::AddShortcut(
}
void AddToHomescreenManager::Start(content::WebContents* web_contents) {
pkotwicz 2016/09/29 14:18:54 Thank you for making the changes in this file. The
F 2016/09/30 18:02:02 Done. Will do :)
- bool check_installable = false;
+ // Check whether to check WebApk compatibility.
+ bool check_webapk_compatible = false;
if (ChromeWebApkHost::AreWebApkEnabled() &&
content::IsOriginSecure(web_contents->GetLastCommittedURL())) {
- check_installable = true;
+ check_webapk_compatible = true;
} else {
ShowDialog();
}
@@ -82,7 +83,7 @@ void AddToHomescreenManager::Start(content::WebContents* web_contents) {
ShortcutHelper::GetMinimumHomescreenIconSizeInDp(),
ShortcutHelper::GetIdealSplashImageSizeInDp(),
ShortcutHelper::GetMinimumSplashImageSizeInDp(),
- check_installable, this);
+ check_webapk_compatible, this);
}
AddToHomescreenManager::~AddToHomescreenManager() {
@@ -152,7 +153,7 @@ void AddToHomescreenManager::OnUserTitleAvailable(
void AddToHomescreenManager::OnDataAvailable(const ShortcutInfo& info,
const SkBitmap& icon) {
if (is_webapk_compatible_) {
- CreateInfoBarForWebAPK(info, icon);
+ CreateInfoBarForWebApk(info, icon);
return;
}
@@ -167,7 +168,7 @@ void AddToHomescreenManager::OnDataAvailable(const ShortcutInfo& info,
AddShortcut(info, icon);
}
-void AddToHomescreenManager::CreateInfoBarForWebAPK(const ShortcutInfo& info,
+void AddToHomescreenManager::CreateInfoBarForWebApk(const ShortcutInfo& info,
const SkBitmap& icon) {
banners::AppBannerInfoBarDelegateAndroid::Create(
data_fetcher_->web_contents(), nullptr, info.user_title,

Powered by Google App Engine
This is Rietveld 408576698