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

Unified Diff: chrome/browser/banners/app_banner_data_fetcher.cc

Issue 1148163003: Allow only responsive websites to install as a web app on mobile. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding comment explaining using statement Created 5 years, 6 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/banners/app_banner_data_fetcher.cc
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc
index 64eb8e077c7a9be4a4204c40f54e628379c02ddc..f3247944e9d76dc0b481107b1e922c8c95f37248 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -241,11 +241,15 @@ void AppBannerDataFetcher::OnDidGetManifest(
return;
}
- banners::TrackDisplayEvent(DISPLAY_EVENT_BANNER_REQUESTED);
-
web_app_data_ = manifest;
app_title_ = web_app_data_.name.string();
+ HandleWebApp(web_contents);
+}
+
+void AppBannerDataFetcher::HandleWebApp(content::WebContents* web_contents) {
+ banners::TrackDisplayEvent(DISPLAY_EVENT_BANNER_REQUESTED);
+
// Check to see if there is a single service worker controlling this page
// and the manifest's start url.
Profile* profile =
@@ -256,7 +260,7 @@ void AppBannerDataFetcher::OnDidGetManifest(
DCHECK(storage_partition);
storage_partition->GetServiceWorkerContext()->CheckHasServiceWorker(
- validated_url_, manifest.start_url,
+ validated_url_, web_app_data_.start_url,
base::Bind(&AppBannerDataFetcher::OnDidCheckHasServiceWorker,
this));
}

Powered by Google App Engine
This is Rietveld 408576698